First, left and right cocos2d-x the next Android building environment in Windows,
Cite a netizen this blog "Cocos2d-x 3.0RC Development Guide: Windows Android Environment Build".
Here's a quick list of the tools you need:
1. JDK
: http://www.oracle.com/technetwork/java/javase/downloads/index.html
2. ADT (Android Developer Tools), which includes the SDK and Eclipse.
Yes: http://developer.android.com/sdk/index.html
3. Download Android NDK
Yes: http://developer.android.com/tools/sdk/ndk/index.html
Unzip it into the ADT folder.
4. Download Apache ANT
Yes: http://ant.apache.org/bindownload.cgi
Same unzip to ADT folder
5. Download Python
COCOS2DX uses Python to create and build project on different platforms after 3.0. So the python environment needs to be installed under Windows:
: Https://www.python.org/ftp/python/2.7.3/python-2.7.3.msi
The cocos2d-x i downloaded is the latest version of 3.2, so the following is a cocos2d-x 3.2 download installation and the process of creating a new project.
First, installation
As a prerequisite, you have set up the Android development environment in the above reference article, including Adt-bundle, Apache-ant, PYTHON.
First download from the official site Cocos2d-x, the current latest version of v3.2, the official http://cn.cocos2d-x.org/download/
The installation of cocos2d is described below.
After extracting the downloaded cocos2d-x zip file in the local path to D:\adt-bundle\cocos2d-x-3.2, the following cocos_home_dir represents the path.
The first thing to do is to execute the download-deps.py Python program, which will voluntarily download the third-party plug-in required by cocos2d-x (if any).
Then execute setup.py this Python program, which is mainly to set the relevant environment variables, including the Android SDK,NDK and Apache Ant path.
Once these two steps have been successfully run, you are able to create a new Cocos2d-x project.
Ii. creation of new projects
Open a command-line form in Cocos_home_dir,
(Press and hold shift+ right mouse button, such as the following menu appears.) Select Open command form)
Enter Cocos first to execute
You can then create a new Cocos2d-x project with the following command, for example,
Cocos New Mygame-p com.your_company.mygame-l cpp-d New_projects_dir
In the above command line, Mygame represents the new project name, and New_projects_dir is the path to save for the new project.
Assuming that the-D new_projects_dir is omitted, Cocos creates a new subdirectory under the current directory Mygame,
All source files for the new project will be created under subdirectory mygame.
The new project created by default is a classic HelloWorld program.
Third, compile
1. Using VS for compiling
Under the files for the new project, there are subdirectories for each platform, corresponding Mygame\proj.win32 subdirectories for the Windows platform.
Enter the PROJ.WIN32 subdirectory and be able to see the MyGame.sln file.
See the familiar sln file. Suppose you are a VC developer. Then you will be very skilled in opening this project file, using vs for compiling.
2. Compiling using the command line
The above is compiled with vs. It is also possible to compile using the command line.
Save the following batch command as Build4win2.bat and store it in the new project directory (for example, Mygame above).
You can then run Build4win32.bat to compile the newly created project Mygame.
@echo execute the following command under the Cocos Project directory to compile and execute the project (for Win32)
Cocos Run-p Win32
Assume that you want to compile to an Android platform. Use the following batch command, for example
@echo execute the following command under the Cocos Project directory to compile and execute the project (for Android)
Cocos Run-p Android-j 4
Iv. End of
There are many other specific instructions for installing and compiling to see the Readme file that Cocos2d-x comes with.
The detailed file name is called: cocos_home_dir\readme.md.
Copyright notice: This article Bo Master original article. Blog, not reproduced without consent.
Windows Cocos2d-x 3.2 Download a new project, create the process