Cocos2d-x simple way to create a project using a Python script

Source: Internet
Author: User


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
  1. @echo off
  2. set/p projectname= Please enter the project name:
  3. If "%projectname%" = = "goto Inputerror
  4. set/p Packagename= Please enter the package name:
  5. If "%packagename%" = = "goto Inputerror
  6. Create_project.py-project%projectname%-package%packagename%-language CPP
  7. Pause
  8. Exit
  9. : Inputerror
  10. @echo Project name or package name cannot be empty!

  11. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.