1, function, variable appears "could not be resolved" problem
This problem typically occurs when the header file for the Cocos2d-x declaration is not found, and the cocos2d header file directory is introduced in Eclipse, including the project catalog, platform/android
Adding a header file to the Hellocpp/main.cpp function
#include "AppDelegate.h" #include "cocos2d.h" #include "CCEventType.h" #include "platform/android/jni/jnihelper.h" # Include <jni.h> #include <android/log.h> #include "CCEGLView.h" #include "CCApplication.h"
2, remove the lower left corner of the screen three lines of numbers
Description of three lines of numbers:
First row render batches for the current scene
The second line takes time to render each frame
The third line is FPS
In AppDelegate.cpp file applicationdidfinishlaunching () find the following line modified to False
Pdirector->setdisplaystats (FALSE);
3. Transplant Android, Game Adaptive Mobile screen
In the AppDelegate.cpp file applicationdidfinishlaunching () function, add the following code.
Cceglview::sharedopenglview ()->setdesignresolutionsize (1136, 640, Kresolutionshowall);//Set resolution: Wide, High, mode
4. Modify APK app name and icon
Modified Name: Eclipse Project Res->values->strings.xml File
<?xml version= "1.0" encoding= "Utf-8"?><resources> <string name= "app_name" > Yellow man </string ></resources>
Replace icon: will prepare the different size icon, replace the Eclipse project res under drawable-* corresponding directory under the PNG image, the program will call the corresponding icon according to the phone's resolution