使用bat快速创建cocos2d-x模板
在上一篇文章中我们学习了如何使用python创建cocos2d-x 2.2工程,但是每次我们都输入一大串的命令,好烦好烦啊。参考别人的文章这里写了一个bat,如下
@echo off echo -------------------------create project with python----------------------------- echo -------------------------------firedragonpzy------------------------------------ echo -------------------discuz:http://bbs.firedragonpzy.com.cn----------------------- echo --------------Software MyZone:http://www.firedragonpzy.com.cn------------------- set /p project_name= "Please enter your project name [for example: Runner] : " echo --------your project name : %project_name% set /p package_name= "Please enter your package name [for example: com.firedragonpzy.roy ] : " echo --------your package name : %package_name% set /p language_type= "Please enter your language types [cpp | javascript | lua] : " echo --------your language types : %language_type% set temp_path=\tools\project-creator set project_path=%cd%%temp_path% cd %project_path% set temp_path=\create_project.py -project %project_name% -package %package_name% -language %language_type% set last=%project_path%%temp_path% %last% pause
将这段代码保存到一个txt文件中,同时修改txt文件名称为 cocos2dx创建新项目.bat,将这个文件放置在 cocos2d-x 源文件的根目录中。
哈哈,建一个快捷方式放置到桌面上,每次创建工程时候,只要点击这个快捷方式就可以了