How Cocos2d-x-2.2.1 creates a project and how to separate it

Source: Internet
Author: User

I do not know the cocos2d-x from the first few versions to create a project with python, anyway, I recently downloaded the cocos2d-x-2.2.1 is to create with python, basically is a sentence to help us get it done, saves us a lot of trouble.

The procedure for creating a windows instance is as follows:

Open the windows command line, open the directory to cocos2d-x-2.2.1 \ cocos2d-x-2.2.1 \ tools \ project-creator, and then directly call create_project.py, it will give you the following prompt:

I wrote this sentence to create a lua project:

Create_project.py-project: MyGame-package com. MyCompany. AwesomeGame-language lua

Then you will see "Have Fun!" at the end !" (I forgot to say my python is 2.7)

At the same time, it will create the project under the projects directory of your cocos2d-x2.2.1, and normally, we do not put the project here, because if we want to update a later version, it's hard to copy it to a later version directory. Of course not, therefore, we have to separate the created Project.

The procedure is as follows:

(1) define system environment variables (the variable value is the path of the cocos2dx library on my computer)

Variable name: COCOS2DX_ROOT

Variable values: D: \ project \ libraries \ cocos2d-x-2.2.1 \ cocos2d-x-2.2.1

(2) copy the project you just created to the desired place (as long as it is not under the cocos2d-x2.2.1 directory)

(3) Open the project under the proj. win32 Directory under the project: MyGame. vcxproj

You can see after libBox2D, libchipmunk, libcocos2d, libCocosDenshion, libExtensions, and liblua

It doesn't matter if they are all unavailable. Just remove them and add them one by one.

(4) Right-click the project (MyGame)-> properties-> Configuration properties-> C/C ++-> General, select "add include directory"-> edit on the right, except $ (ProjectDir ).. except \ Class, other $ (ProjectDir ).. \.. \.. change

The environment variable $ (COCOS2D_ROOT) We just defined is before and after the change:

Before change:

After the change:

(5) click OK and then select ky "http://www.bkjia.com/kf/web/php/" target = "_ blank" class = "keylink"> PHPwtfzsd + fill + obDUpM/fill + 1 xKGww/fill + 86qo7o8L3A + Cgo8cD4gICAgeGNvcHkg "$ (COCOS2DX_ROOT) \ scripting \ lua \ script "" $ (ProjectDir ).. \ Resources "/e/Y

(6) Click "OK" and select "generate event"-> "pre-linked event" on the left, and select "command line"-> "edit" on the right ", it also sets "$ (ProjectDir ).. \.. \.. "with" $ (COCOS2DX_ROOT) ", the result is:

If not exist "$ (OutDir)" mkdir "$ (OutDir )"

Xcopy/Y/Q "$ (COCOS2DX_ROOT) \ external \ libwebsockets \ win32 \ lib \ *. *" "$ (OutDir )"

(7) be sure, run, and make it easy. (5) and (6) the two sentences I found are really hard, at the beginning, I didn't know where to configure it. I had to spend 2 or 3 minutes, and I decided to record it.


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.