Xcode incorrectly load file CSB

438 Views Asked by At

I am working in Cocos2d-x v3.3 and Cocostudio v2.0.6.

I followed the instructions to create and load files CSB onto xcode, but it works in Windows and failed in MacOS.

XCode can not read the sub-control and show the black screen in Simulator.

Node* node = CSLoader::getInstance()->createNode("MainScene.csb");
float scale = node->getContentSize().width/m_screenSize.width;
node->setScale(scale);
this->addChild(node,1);
1

There are 1 best solutions below

0
On

Please add "res" folder to the project at root level by make it as references ( blue color folder icon ).

I have face something similar when I give a try with blank scene with only one button with image as a normal button state. I found error message which is missing the image file.

One more thing. Please try avoid set scale then retest again.