This article has cc original. Reprint Please specify address:http://blog.csdn.net/oktears/article/details/13297003
In the version number above cocos2d-x2.1.4. Canceling the method of creating a project using the VS template, starting with a Python script to create a project, creating a project with Python requires a lot of instruction at the command line, which is more cumbersome.
I put these commands together and put them in a batch file. A direct double-click to open a batch file allows you to create a project with a few simple instructions.
First step: Create a new TXT file. Copy the code below to save the file. Change the file name to Create_project.bat.
[Plain]View Plaincopy
- @echo off
- set/p projectname= Please enter the project name:
- If "%projectname%" = = "goto Inputerror
- set/p Packagename= Please enter the package name:
- If "%packagename%" = = "goto Inputerror
- Create_project.py-project%projectname%-package%packagename%-language CPP
- Pause
- Exit
- : Inputerror
- @echo Project name or package name cannot be empty!
- Pause
For example, as seen in:
Step Two: Put create_project.bat this file under your Cocos2d-x \tools\project-creator folder
is the folder of my computer, everyone according to their own computer actual path placement
Note that you must put the Create_project.bat in the same folder as create_project.py, or you will not find the. py file, assuming that it is more cumbersome to open this path each time, and be able to create a shortcut to the desktop. But do not copy directly to the desktop!
The third step: direct double hit Open create_project.bat can be. The following interface appears, enter your project name and package name is OK, do not need to specify the language used, has been set up in C + +, after the creation of the following interface.
watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvb2t0zwfycw==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast "style=" border:none; max-width:100% ">
OK, go to the Projects folder and find your project.
Cocos2d-x simple way to create a project using a Python script