零、引言
本文内容为js自动绑定的环境搭建,ccc环境为2.0.5,参考文档如下
~\resources\cocos2d-x\tools\tojs\README.mdown
How to Use bindings-generator
==================
On Windows:
------------
* Make sure that you have installed `android-ndk-r16` or later.
* Download python2.7.3 (32bit) from (http://www.python.org/ftp/python/2.7.3/python-2.7.3.msi).
* Add the installed path of python (e.g. C:\Python27) to windows environment variable named 'PATH'.
* Download pyyaml from http://pyyaml.org/download/pyyaml/PyYAML-3.11.win32-py2.7.exe and install it.
* Download [Cheetah-2.4.4.tar.gz](https://pypi.python.org/packages/cd/b0/c2d700252fc251e91c08639ff41a8a5203b627f4e0a2ae18a6b662ab32ea/Cheetah-2.4.4.tar.gz#md5=853917116e731afbc8c8a43c37e6ddba), extract and install it by `python setup.py`.
* Set environment variables (`NDK_ROOT`) and `PYTHON_BIN`
* Go to "cocos2d-x/tools/tojs" folder, and run "genbindings.py". The generated codes will be under "cocos\scripting\auto-generated\js-bindings".
一、环境搭建流程
1.安装32位 python2.7.3
详情参考网上教程,并设置环境变量
2.安装ndk-r16或之后的版本
ndk下载路径,进入页面后要等待一会才会加载完成,进入如下页面,点击按钮才会进入ndk下载页面
3.安装PyYAML
4.安装Cheetah
Cheetah下载路径
下载解压后,执行python setup.py install
5.添加环境变量
NDK_ROOT:PYTHON_BIN:
6.验证环境搭建是否成功
运行如下脚本
~\resources\cocos2d-x\tools\tojs\genbindings.py
运行失败:
失败处理:
ccc2.0.5的以下目录缺少上图的三个文件,解决方案是拷贝cocos2d-x-3.17下相同目录的文件,即可解决问题
resources\cocos2d-x\tools\tojs
运行成功:
creator脚本手动绑定环境搭建成功
网友评论