Create a new project
Before creating new project, make sure you have set the QUICK_COCOS2DX_ROOT
environment variable to the right path, refer to:
~
Create a new project with Mac
Launch Terminal
Application, come to the directory for the new project:
> cd ~/Desktop
Run create_project.sh
, and specify the package name of your project:
> $QUICK_COCOS2DX_ROOT/bin/create_project.sh com.mycompany.games.game01
create_project.sh
shell script will use the last part of package name as your project directory name, so the upper command will create a directory with the name game01
.
After that, you can see the following result:
~
Then you can use the player to run a project. Alternatively, open a project file in the proj.ios
or proj.android
directory, test it on a real device.
~~
Create a new project with Windows
Similar to the Mac environment, you just run create_project.bat
in the cmd.exe
window.
CAUTION: Don't run create_project.bat
or create_project.sh
in a cygwin window
> %QUICK_COCOS2DX_ROOT%\bin\create_project.bat com.mycompany.games.game01
~~
Specify the screen orientation when creating a new project
use -o
argument to specify the screen orientation, the legal value could be landscape
or portrait
. e.g.:
> $QUICK_COCOS2DX_ROOT/bin/create_project.sh -o landscape com.mycompany.games.game01
If you want to change the screen orientation for your existing project, please see How to set the screen orientation of the game 。