- Notifications
You must be signed in to change notification settings - Fork197
cocos2d/cocos2d-console
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
$ NOT DONE YET
$ NOT DONE YET
A command line tool that lets you create, run, publish, debug, etc… your game. It is the swiss-army knife for cocos2d.
This command line tool is in its early stages.
Examples:
# starts a new project called "My Game" for multi-platform$ cocos new MyGame -l cpp -p org.cocos2d.mygame$ cd MyGame# Will deploy the project to device and run it$ cocos run -p androidcocos.py is an script whose only responsability is to call its plugins.cocos.bat will invokecocos.py on windowscocos will invokecocos.py on Mac OS X and linux
To get a list of all the registered plugins:
$ cocosTo run the "new" plugin:
$ cocos newYou have to editbin/cocos2d.ini, and add the class name of your new plugin there. Let's say that you want to add a plugin that deploys the project:
# should be a subclass of CCPluginproject_deploy.CCPluginDeployAnd now you have to create a file calledproject_deploy.py in theplugins folder.A new, empty plugin, would look like the code shown below:
import cocos# Plugins should be a sublass of CCPluginclass CCPluginDeploy(cocos.CCPlugin):# in default category @staticmethod def plugin_category(): return "" @staticmethod def plugin_name(): return "deploy" @staticmethod def brief_description(): return "Deploy the project to target." def run(self, argv, dependencies): print "plugin called!" print argvPlugins are divided by category, depending on it's function: project, engine, ...
The plugins ofproject is in default category, it's an empty stirng"".
Now you can use thetoexec/build_console.py for generating a executable file ofcocos command.
- Python 2.7 (2.7.5 is well tested)
- PyInstaller (PyInstaller 2.1 is well tested)
- Necessary PATH environment for python & pyinstaller.
Attention:To keep compatible with both Windows-32bit & Windows-64bit, please install 32bit python on Windows.
Runpython build_console.py in command line. Then the executable file & necessary files will be generated intoexec/output/PLATFORM.
The usage ofbuild_console.py:
usage: build_console.py [-h] [-s SRC_PATH] [-d DST_PATH]Generate executable file for cocos2d-console by PyInstaller.optional arguments: -h, --help show this help message and exit -s SRC_PATH, --src-path SRC_PATH Specify the path of cocos2d-console. -d DST_PATH, --dst-path DST_PATH Specify the path of output.The generated executable files can replace the source code of cocos2d-console.
To fit the limitation of the cocos2d-console implementation. The generated executable files should located atENGINE_PATH/tools/cocos2d-console/bin.
Then you can use the executable file as same as the source code.
Please see thisissue
About
cocos2d command line tool
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.