Cocos2dx 3.0 transition article (18) Cocos2d-x 3.0rc, another way to create a project

Source: Internet
Author: User

3-15, cocos2dx 3.0rc0 was finally released. One thing I have to say here is that version 3.0, from Alpha, beta, to rc, has their own project creation methods,Is this really true?

The method for creating projects for the rc version has greatly changed, so I will use a simple introduction here (in fact, I am also a temporary assault, and the project has been quite busy recently ).
--------------------------
Preparations:
1. download the latest cocos2dx 3.0rc0, http://www.cocos2d-x.org/download
2. Download python 2.7. If python 3.3 has been downloaded before, skip this step. If python 2.7 or later is downloaded, download python again, don't ask me why, because the following will secretly tell you: https://www.python.org/download/releases/2.7.6/

3. download the required NDK, SDK, and ant for the android development environment.

----------------------

The following is the time to witness the miracle:
1. added a configuration file named setup. py to the root directory of the cocos2dx file.
. Run it to configure the systemEnvironment Variable.
1) Open cmd on the console and enter the root directory of cocos2dx.
2) enter the command: python setup. py. The running result is shown in.(Note that if you do not configure environment variables such as NDK, you will be asked to enter the path of NDK, SDK, and ant.)


3) If you use python, the following error occurs when you run python setup. py:
C: \ outfiles \ cocos2d-x-3.0rc0> python setup. py
File & quot; setup. py & quot;, line 114
Print 'Warning: cocould not add "% s" into registry '% key

SyntaxError: invalid syntax

2. After running setup. py, check the environment variables, for example:

The NDK and SDK paths are added to the environment variables.Cocos2d-consoleIt is under the cocos2d-x-3.0rc0 \ tools \ cocos2d-console \ bin, path. I heard that there are a lot of cocos2d-console functions, I have not specific to understand, only know the more called "cocos" command, and then you can create win32, android platform project through this command. as follows:

Create a project (in brackets)In the cmd ConsoleType cocos new hello (project name)-p com. star. hello (package name)-l cpp (project type)-d E: \ MyCocos \ cocos2dx_workspace (Project Storage path)
Create a project named hello, as shown in:

3. Run the win32 Project.You do not need to open VS to run the project.The steps are as follows:
Enter the project directory in cmd on the console, that is, the project hello directory that I just created, and enter the command:Cocos run, As shown in:


Here you are prompted to use-p to select the platform to run. Here I am win32, So I enter the command:Cocos run-p win32. OK to start compilation. (Every time I compile a program, I want to smash my computer! Can you slow down? Haha, you are really slow ...)

In fact, VS is used to compile the project and finally call the simulator of...

4. Run the android Project. Run"Cocos run". The debug apk is displayed and automatically connected to the device. As shown in:

Now we can start the android simulator or connect to the real machine to install and run our apk.

Okay, that's probably the case.
Respect Original, reprinted before the instructions: http://blog.csdn.net/start530/article/details/21483729

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.