I’ve made a test C++ project which uses Cocos2d-x-3.17.2
I’ve also managed to export a test scene from CocosCreator using this plugin: https://github.com/cocos2d/creator_to_cocos2dx#how-to-generate-the-needed-files
But now, when I try to load it in my project, I see that CreatorReader.cpp is using some methods from Cocos-2d-x-14, which do not exist anymore.
Does anybody know is there an updated version for this plugin,
or is there any other way to load a scene from CocosCreator?
Thanks in advance!
there any other way to load a scene from CocosCreator?
I using cocos2d-x-3.17.2 & creator_to_cocos2dx for windows.
I sucess to build CreatorReader from cmake.
I Added ,
reader/CMakeLists.txt & reader/dragonbones/CMakeLists.txt
I added creator-luacpp-support/ reader in my project’s source code (which uses cocos2d-x-3.17.2).
These are the compilation errors in CreatorReader:
error C2039: ‘setCenterRectInPixels’: is not a member of ‘cocos2d::SpriteFrame’
error C2039: ‘setTitleLabel’: is not a member of ‘cocos2d::ui::Button’
error C2039: ‘setCenterRectNormalized’: is not a member of ‘cocos2d::Sprite’
error C2039: ‘setFontSize’: is not a member of ‘cocos2d::ui::RichText’
error C2039: ‘setFontFace’: is not a member of ‘cocos2d::ui::RichText’
error C2259: ‘creator::RichtextStringVisitor’: cannot instantiate abstract class
error C2039: ‘parseIntrusive’: is not a member of ‘cocos2d::SAXParser’
error C2039: ‘initWithXML’: is not a member of ‘cocos2d::ui::RichText’
error C2039: ‘setStretchEnabled’: is not a member of ‘cocos2d::Sprite’
error C2039: ‘getSlidBallNormalRenderer’: is not a member of ‘cocos2d::ui::Slider’
error C2039: ‘getSlidBallRenderer’: is not a member of ‘cocos2d::ui::Slider’
error C2039: ‘setIndicatorIndexNodesTexture’: is not a member of ‘cocos2d::ui::PageView’
You say, that you are able to read the exported from CocosCreator scene in a C++ project?
Thank you!
For my cocos2d-x 3.17.2 engine source,
For example: cocos2d :: SpriteFrame :: setCenterRectInPixels
Is
cocos2d-x \ cocos \ 2d \ CCSpriteFrame.h (157,10)
void setCenterRectInPixels (const Rect & centerRect);
There was a definition in.
Yes, but I’m having another problem and I’m trying now.
The position of Node is not reflected and is displayed in all (0,0).
The .fire stores the position probably as “_tri” instead of “position”. There is no word “_tri” in the js code of the plugin, so it may be a problem with the version of cocos creator.
Sorry, guys
the problem was on my side.
As @F14Tomcat mentioned, the listed above “missing” methods actually do exist in Cocos2d-x-3.17.2.
I am not sure how this happened, but it could be related to CocosStudio, which I had installed earlier in order to test it.
Later, I used the command line tools to generate a test project (“cocos new Game_1…”). The generated project included the source code from CocosStudio instead of the one from Cocos2d-x-3.17.2.
So it seems that we can still use CocosCreator as GUI for C++ projects.