Cocos2d-x v3.1 Project Creation (III)

Source: Internet
Author: User

Cocos2d-x v3.1 Project Creation (III)

Cocos2d-x v3.1 Project Creation (III)

Cocos2d-x provides us with a set of command line tools for creating, compiling, running, and deploying, that is, the Cocos2d-Console we mentioned in the previous article, it is located in the tools subdirectory under our engine directory. This article mainly describes how to create a Cocos2d-x project, so the compilation, running and deployment will not be introduced. In the future, we will compile, run, and deploy the project in the ADT development environment, but the project development will be carried out in VS2012.

First, let's take a look at some of the relevant parameters of the Cocos2d-Console and demonstrate how to generate a project through an instance, the generated project contains the android, wp8, IOS and win32 projects. Next we will step into the introduction of the Cocos2d-Console command line tool.

1. Introduction to Cocos2d-Console Parameters

Command Format: cocos [command] [arguments]

[Command]: There are 5 optional values:

Compile is used to compile the new project of different platforms, generate the project (which we will use) run, run the project jscompile, compile js into the jsc file deploy for deployment

[Arguments]: Different [Commands] have different values.

Now, enter cocos -- help in the CMD command line to view the specific help information, as shown in:

To generate a project, you only need the "new" command. Now let's take a look at its detailed description and enter cocos new-help, for example:

-H,-l, and-d do not have to read the description to know what it means, the only difference is that-p and-t are not required when these two parameters are generated for the project.

-P option: set the project package name. In android, each project requires a package name. Note that the package must have three levels, for example, Test. cocos. tutorial. -t option, which is used to set the template for the project to be created. The default value is default, that is, the "cpp-template-default" directory in the templates directory under the engine directory.

Ii. Generate a project

Now we generate a project instance. I want to generate a Tutorial project under the local directory "D: \ CocosProject". To illustrate the use of these parameters, we try to use multiple parameters, although some are not necessary. Enter "cocos new-p Test. Cocos. Tutorial-l cpp-d: \ CocosProject-t default Tutorial" in CMD ". For example:

Go to the "D: \ CocosProject" and find the Tutorial directory.

PS: It is recommended that you do not directly copy the above command string for possible errors. Enter an article by yourself! It may be caused by encoding problems.

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.