-
Notifications
You must be signed in to change notification settings - Fork 105
How to support a new feature of creator
minggo edited this page Feb 8, 2018
·
2 revisions
The workflow of this plugin is as follows:
- find a
xxx.fire
inCREATOR_PROJECT_ROOT/assets
- parse each
.fire
file and generate the corresponding.json
file. - invoke flatbuffer executable,
flatc
, to convert generated.json
file to .ccreator (a flatbuffer binary format) - modify
CreatorReader
to parse new generated content
The steps to parse new feature are:
- modify
Node.guess_type()
(core/parser/Node.js
), to support a new type of node - add a new javascript file in
creator-luacpp-support/core/parser
to parse new feature (iecore/parser/MyNewElement.js
) - modify
Utils.create_node()
(core/parser/Utils.js
), to support new type (include the new JS file and add it to the type map)
The steps to convert .json to .ccreator are:
- Modify
creator-luacpp-support/CreatorReader.fbs
to add a new type for new feature. Should add properties that are needed when creating cocos2d-x node to support new feature. For example, if you want to create a new Sprite, then you may need: texture, blend function and so on. - invoke
creator-cpp-support/bin/flatc or flatc.exe -c creator-luacpp-support/CreatorReader.fbs
to updatecreator-luacpp-support/reader/CreatorReader_generated.h
. This should be done fromcreator-luapcpp-support/reader
to ensure the outputCreatorReader_generated.h
is in the right folder.