Cocostudio: How to use the exported scene file. Does CCSceneReader work for everyone?

I created a new scene in cocostudio and exported it. This export included a json file for the scene and a couple of other image directories and so on. Today I installed cocostudio and cocos2dx 3.0.

I continue to work with this code:

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

I saw it in cocos2dx help docs (at the bottom of the page) and several other places on the Internet.

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

I am open to other ways of using cocostudio export that don't use CCSceneReader, but I still need to find something that works. Has anyone got this job successfully?

+4
source share
1 answer

erparker left this answer in this comment

Ultimately, this showed that this is the result of ignorance with cocos2dx. If someone was wondering, you need to remove "CCS" from the scraper, and also add "cocostudio ::" if you are not using the cocostudio namespace (which by default is not "I also need to add", #include "editor- support / cocostudio / CocoStudio.h "into my header file, so by default your new cocos2dx project does not use cocostudio. You need to add it

+1
source

Source: https://habr.com/ru/post/1534882/


All Articles