Engine Customization Workflow
- Creator-JS engine: https://github.com/cocos-creator/engine
- Cocos2d-x-lite engine：https://github.com/cocos-creator/cocos2d-x-lite
If you want to customize engine, we recommend that you follow the fork workflow thru GitHub. Please read GitHub help: Fork A Repo to learn the details.
If your concern is only Web based games, or what you want to change in the engine is not native API related (for example UI and animation components), you just need to follow the workflow here:
First, you need to clone the engine repository or fork the repo. You have to make sure the repo is
at the corresponding branch. For example to customize engine for Cocos Creator v1.1.2 you'd need
v1.1 branch; for Cocos Creator v1.2.1 you'd need to checkout
Once cloning is completed, go to the repo's folder in command-line shell.
Install NPM Dependencies
npm and gulp are core components for engine building. These need to be installed. Example:
npm install -g gulp npm install
Change and Build
Now you can do whatever you want to the engine, once you finished:
# build engine gulp build
This will generated a compiled engine to
Use customized engine in Cocos Creator
Customized Cocos2d-x C++ Engine
Once cloned, enter the Cocos2d-x-lite engine folder and run:
# Install NPM dependencies npm install # download binary dependencies, you'll need python working first python download-deps.py # update submodule repos, you'll need git git submodule update --init
Used customized cocos2d-x-lite engine in Cocos Creator
Goto Preferences panel and click Native Develop Tab. And follow the guide to set the path to your customized cocos2d-x-lite engine.
Build from Source
Next, you can start working on updating code for Cocos2d-x-lite. If you want to use source code in your
built project you can just choose
default template in Build panel and compile from the source, no
extra command line work needed.
Build binary library and simulator
If you want to use a
binary template to build and compile native project (it's much faster since C++
code are already compiled), you'll need to run these commands:
# use cocos console to generate prebuilt binary libs gulp gen-libs
To generate simulator to preview your changes:
# use cocos console to generate simulator gulp sign-simulator gulp gen-simulator gulp update-simulator-config
gulp sign-simulator is a new command since 1.7.0. Only Mac need to run it. See Build simulator for details.
Creator >= 1.7, please refer to:
Creator <= 1.6, please refer to: