Skip to content

How to support a new feature of creator

minggo edited this page Feb 5, 2018 · 2 revisions

Workflow

The workflow of this plugin are:

  • find a xxx.fire in CREATOR_PROJECT_ROOT/assets
  • parse founded .fire file and generate .json file for the corresponding .fire file
  • invoke flatbuffer executable to convert generate .json file to .ccreator(flatbuffer binary format)
  • modify CreatorReader to parse new generated content

parse new feature in .fire

The steps to parse new feature are:

  • modify Node.guess_type()(Node.js) to support a new type of node
  • modify Utils.create_node()(Utils.js) to support new type
  • add a new javascript file in creator-luacpp-support/core/parser to parse new feature

convert .json to .ccreator

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 needed when creating cocos2d-x node to support new feature. For example, if want to create a new Sprite, then you many need: texture, blend function and so on.
  • invoke creator-cpp-support/bin/flatc|flatc.exe -c creator-luacpp-support/CreatorReader.fbs to update creator-luacpp-support/reader/CreatorReader_generated.h
Clone this wiki locally