I am working on the creator plugin. Currently i finished most things. The steps to use the plugin is:
- clone https://github.com/ricardoquesada/creator_to_cocos2d
- merge the PR: https://github.com/ricardoquesada/creator_to_cocos2d/pull/8
- use creator to open
creator_projectand open the project
Project -> LuaCPP Support -> Setup Target Project
- fill in
Project Path, it is a c++ or lua project created by cocos2d-x console
- click Build
You you find all needed source codes are copied to
NATIVE_PROJECT_ROOT/frameworks/runtime-src/Classes in lua), and all resources are copied to
NATIVE_PROJECT_ROOT/res/creator in lua).
You can just use the readers and resources in your project to have a test. If using c++, then you need to add these codes
#include "reader/CreatorReader.h" auto reader = creator::CreatorReader::createWithFilename("creator/CreatorSprites.ccreator"); reader->setup(); auto scene = reader->getSceneGraph(); director->runWithScene(scene);
If using lua, then you need to add these codes in c++ and lua.
add binding codes in c++
#include "reader/CreatorReaderBinding.h" ... register_all_creator_reader_manual(L);
use in lua
local creatorReader = cc.CreatorReader:createWithFilename('creator/CreatorSprites.ccreator') creatorReader:setup() local scene = creatorReader:getSceneGraph() cc.Director:getInstance():replaceScene(scene)
Please let me know if you meet any problem. Thanks.