Cocos2d-x 3.1 modify program name, icon, and screen direction

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.