首页 技术 正文
技术 2022年11月11日
0 收藏 410 点赞 4,571 浏览 2185 个字

非常多新手程序员做出一个游戏后,编译成apk安装在手机上。却发现安装程序名和游戏图标都是Cocos2dx默认的,并且默认屏幕方向是横向。那么须要怎么才干改动为自己想要的呢?

打开你创建的project-找到proj.android,找到AndroidManifest.xml并编辑:

<?xml version="1.0" encoding="utf-8"?

>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"

      package="com.Irvingrain.hellocpp"

      android:versionCode="1"

//这里已经给我们提示当前程序的版本。

android:versionName="1"

//这里已经给我们提示当前程序的版本号名称,比如1.1、1.2,假设须要改动游戏版本号能够改动这个值。

android:installLocation="auto">

    <uses-sdk android:minSdkVersion="9"/>

    <uses-feature android:glEsVersion="0x00020000" />

    <application android:label="@string/app_name"//这里已经给我们提示:@string/app_name说明在string.xml定义了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="landscape"

                  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"/>

    <!–uses-permission android:name="android.permission.WAKE_LOCK" 禁止手机休眠/–>

</manifest>

1.改动程序名:打开proj.android\res\values下。string.xml

<?xml version="1.0" encoding="utf-8"?>

<resources>

    <string name="app_name">程序名</string>

</resources>

//假设安装游戏后出现游戏中文名乱码。预计是你这个string.xml的编码有问题。建议用EditPlus把这个文件编码更改为UTF-8后覆盖。

2.改动游戏图标:

打开 proj.android/res,这个目录以下有三个目录drawable-hdpi、drawable-mdpi、drawable-ldpi。

将自己要改动成的图标按原来的像素制作好后覆盖。假设安装到手机图标还是没有改变,那个预计是之前留下的缓存,

建议卸载游戏后先清理系统垃圾和缓存文件再又一次安装,就可以解决。

3.改动屏幕的方向:改动上面的AndroidManifest.xml,找到android:screenOrientation:

默认是横屏landscape,竖屏是portrait。

4.改动游戏版本:改动上面的AndroidManifest.xml,找到android:versionName="1"。

改动这个数值,如(1.1、1.2)

相应假设android:versionName="2",建议android:versionCode="2"

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,492
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,907
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,740
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,494
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,132
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,295