Cocos2d-x game development modify program name modify icon modify Screen
After creating a game, compile it into an APK and install it on your mobile phone. You will find that both the program name and icon are default, and rest assured that the default screen is landscape. Where can you change it?
Open the project-> proj. Android, find androidmanifest. XML, and open:
<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.pianotiles.org" android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="9"/> <uses-feature android:glEsVersion="0x00020000" /> <application android:label="@string/app_name" android:icon="@drawable/icon"> <!-- Tell Cocos2dxActivity the name of our .so --> <meta-data android:name="android.app.lib_name" android:value="cocos2dcpp" /> <activity android:name="org.cocos2dx.cpp.AppActivity" android:label="@string/app_name" android:screenOrientation="portrait" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:configChanges="orientation"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> <supports-screens android:anyDensity="true" android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true"/> <uses-permission android:name="android.permission.INTERNET"/></manifest>
First look at the application Tag:
Android: Label: Application name. @ string/app_name indicates that. the app_name tag is defined in XML and can be found in proj. search for string in the android/RES/values directory. XML file and modify it.
Android: icon: program icon. Open proj. android/RES found three folders with the drawable Prefix: drawable-hdpi, drawable-mdpi, and drawable-ldpi. The stored images correspond to high-resolution, medium-resolution, and low-resolution images respectively.
Look at the activity tag again:
Android: Name: Activity Class Name, which must be specified.
Android: Label: After this is defined, the Android: label in the application will be overwritten.
Android: screenorientation: the screen is safe. The default screen is landscape, and the portrait screen is portrait.
Cocos2d-x 3.1 modify program name, icon, and screen direction