4
votes

I created a new scene in cocostudio and exported it. That export included a json file for the scene and a couple other directories with the images and so forth. I installed cocostudio and cocos2dx 3.0 fresh today.

I keep running in to this like of code:

CCSSceneReader::sharedSceneReader()->createNodeWithSceneFile("your_scene.json");

I've seen it on the cocos2dx help docs(bottom of the page) and a few other places online.

The problem is that no class called CCSceneReader comes with cocos2dx and I am not sure where to find it.

I'm open to other means of using the cocostudio export that don't use CCSceneReader but I have yet to find anything that works. Has anybody got this working successfully?

1
Figured it out eventually, just a result of being unfamiliar with cocos2dx. If anyone was wondering, you need to remove the "CCS" from scene reader and also add "cocostudio::" if you're not already using the cocostudio namespace (which by default, you're not" I also needed to add "#include "editor-support/cocostudio/CocoStudio.h" to my header file. So, by default your new cocos2dx project isn't using cocostudio. You need to add iterparker
Ahh man I was wondering about this, too. Thanks!!Ethan Parker

1 Answers

1
votes

erparker left this answer in this comment

Figured it out eventually, just a result of being unfamiliar with cocos2dx. If anyone was wondering, you need to remove the "CCS" from scene reader and also add "cocostudio::" if you're not already using the cocostudio namespace (which by default, you're not" I also needed to add "#include "editor-support/cocostudio/CocoStudio.h" to my header file. So, by default your new cocos2dx project isn't using cocostudio. You need to add it