1. "cocould not be resolved" occurs in functions and variables.
This problem is generally not found the header file of the cocos2d-x Declaration, in eclipse will be cocos2d header file directory introduced, including the project directory, platform/android
Add the 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 three rows of numbers in the lower left corner of the screen.
Description of three rows of numbers:
The first line is the rendering batch of the current scenario.
The time required for rendering each frame in the second line
The third line is FPS.
In the AppDelegate. cpp file applicationDidFinishLaunching (), find the following line and change it to false.
pDirector->setDisplayStats(false);
3. Porting android and game adaptive mobile phone screen
In the AppDelegate. cpp file applicationDidFinishLaunching () function, add the following code:
CCEGLView: Export dopenglview ()-> setDesignResolutionSize (1136,640, kResolutionShowAll); // you can specify the width, height, and mode of the resolution.
4. Modify the apk Application name and icon
Modify the name: eclipse project res-> values-> strings. xml file
<? Xml version = "1.0" encoding = "UTF-8"?> <Resources> <string name = "app_name"> Xiao Huang </string> </resources>
Replace icon: Replace the icons of different sizes with the png images under the drawable-* directory of the eclipse project res. The program calls the corresponding icon according to the resolution of the mobile phone.