SceneReader Path Issue

SceneReader Path Issue
0.0 0


Greetings everyone,

currently working with scene export/import.
i’ve loaded the FishJoy 2 scene from CocoStudio:

bool InfoLayer::init()
    if ( !CCLayer::init() ) {return false;}
    CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize();
    CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin(); 	

	if (!CCNode::create()) { return false; }
	CCNode* rootSceneNode;
	SceneReader* sceneReader = SceneReader::sharedSceneReader();
	rootSceneNode = sceneReader->createNodeWithSceneFile("FishJoy2.json");
	if (rootSceneNode == NULL) { return false; }
    return true;

This works great!
But when using a subfolder inside resources folder:

rootSceneNode = sceneReader->createNodeWithSceneFile("somefolder/FishJoy2.json");

This throws an assertion failure, because the file was not found:

Is this a bug in Cocos2D-X-2.2.2? :;qst
Can we load the scenes from subfolders inside the resource folder?
Am i missing something here?
Suggestions are appreciated.

Btw, i am following the docs at:

Related issue:

Thank you in advance

assertfail.jpg (26.7 KB)


So nobody has tried yet?
Editing the paths in the JSON file every export seems like a wrong option.
Can anybody help here?






If you want to use subfolder,you need use add file then choose “Create folder references for any added folders” in XCode, not “create groups for any added folders.”

“create groups for any added folders” it will copy file to device ,have no relative path. but “Create folder references for any added folders” , have relative path.

but I have similar subfolder problem in android version.