笔记--cocos2d-x 3.0 环境搭建

一、下载资源工具

1、下载cocos2d-x 3.0  官网地址:http://www.cocos2d-x.org/filedown/cocos2d-x-3.0-cn

2、下载VS2012 地址网上搜一下很多

3、下载adt-bundle-windows 和 ndk (NDK据说要下载最新的r9d版本)

4、下载ant 官网:http://ant.apache.org/

5、下载python 2.7 ,新版本多人说不合用

二、开始操作

1、安装软件 VS2012 、 sdk、 ndk 、 ant 、 python

2、cocos2d-x 3.0 直接解压到指定目录即可,无需安装

3、配置环境变量:jdk 环境变量、NDK_ROOT 、ANDROID_SDK_ROOT、ANT_ROOT

      将ant bin 和 python bin 添加到path路径中,方便使用

4、运行cocos2d-x-3.0 下的setup.py 初始化检查cocos2d-x环境变量


三、常用指令

1、cocos new 创建工程

usage: cocos new [-h] [-p PACKAGE_NAME] -l {cpp,lua,js} [-d DIRECTORY]
                 [-t TEMPLATE_NAME] [--no-native]
                 [PROJECT_NAME]


Creates a new project


positional arguments:
  PROJECT_NAME          Set the project name


optional arguments:
  -h, --help            show this help message and exit
  -p PACKAGE_NAME, --package PACKAGE_NAME
                        Set a package name for project
  -l {cpp,lua,js}, --language {cpp,lua,js}
                        Major programming language you want to use, should be
                        [cpp | lua | js]
  -d DIRECTORY, --directory DIRECTORY
                        Set generate project directory for project
  -t TEMPLATE_NAME, --template TEMPLATE_NAME
                        Set the template name you want create from


lua/js project arguments:
  --no-native           No native support.usage: cocos new [-h] [-p PACKAGE_NAME] -l {cpp,lua,js} [-d DIRECTORY]
                 [-t TEMPLATE_NAME] [--no-native]
                 [PROJECT_NAME]

Creates a new project

positional arguments:
  PROJECT_NAME          Set the project name

optional arguments:
  -h, --help            show this help message and exit
  -p PACKAGE_NAME, --package PACKAGE_NAME
                        Set a package name for project
  -l {cpp,lua,js}, --language {cpp,lua,js}
                        Major programming language you want to use, should be
                        [cpp | lua | js]
  -d DIRECTORY, --directory DIRECTORY
                        Set generate project directory for project
  -t TEMPLATE_NAME, --template TEMPLATE_NAME
                        Set the template name you want create from

lua/js project arguments:
  --no-native           No native support.

2、使用 cocos compile 编译工程

usage: cocos new [-h] [-p PACKAGE_NAME] -l {cpp,lua,js} [-d DIRECTORY]
                 [-t TEMPLATE_NAME] [--no-native]
                 [PROJECT_NAME]

Creates a new project

positional arguments:
  PROJECT_NAME          Set the project name

optional arguments:
  -h, --help            show this help message and exit
  -p PACKAGE_NAME, --package PACKAGE_NAME
                        Set a package name for project
  -l {cpp,lua,js}, --language {cpp,lua,js}
                        Major programming language you want to use, should be
                        [cpp | lua | js]
  -d DIRECTORY, --directory DIRECTORY
                        Set generate project directory for project
  -t TEMPLATE_NAME, --template TEMPLATE_NAME
                        Set the template name you want create from

lua/js project arguments:
  --no-native           No native support.

四、错误

在编译的时候,发现总算编译出错。发现时ndk所在目录为D:\Program Files 下因为路径中有空格,编译命令执行时总是出错,将ndk的地址更换后,正常编译

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值