-
Couldn't load subscription status.
- Fork 106
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.fireinCREATOR_PROJECT_ROOT/assets - parse each
.firefile and generate the corresponding.jsonfile. - invoke flatbuffer executable,
flatc, to convert generated.jsonfile to .ccreator (a flatbuffer binary format) - modify
CreatorReaderto 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/parserto 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.fbsto 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.fbsto updatecreator-luacpp-support/reader/CreatorReader_generated.h. This should be done fromcreator-luapcpp-support/readerto ensure the outputCreatorReader_generated.his in the right folder.