COCO2DX3.2版本如何加载Cocos Studio导出的*.json文件,请大神帮忙!

COCO2DX3.2版本如何加载Cocos Studio导出的*.json文件,请大神帮忙!
:14: :14: :14: :14: :14: :14: :14: :14: :14: :14: :14: :14: :14: :14:

用createNodeWithSceneFile方法。

auto node = SceneReader::getInstance()->createNodeWithSceneFile(“Demomap/publish/RPGGame.json”);
if (node) {
this->addChild(node, 0);
}

auto bgLayout = node->getChildByTag(10004)->getComponent("CCSprite")->getOwner();
auto bgPos = bgLayout->getPosition();
auto bgPosInGL = Director::getInstance()->convertToGL(bgPos);
auto bgSize = bgLayout->getChildren().at(0)->getContentSize();
bgLayout->setContentSize(bgSize);

动画,UI,场景的加载方式都不一样。
场景的LS已经给了
动画需要先加载。然后再创建。
void ArmatureDataManager::addArmatureFileInfo(const std::string& configFilePath)//动画路径。还可以异步加载,这个不说。
Armature Armature::create(const std::string& name)//动画工程名
UI的用
Widget
GUIReader::widgetFromJsonFile(const char *fileName)

auto node = SceneReader::getInstance()->createNodeWithSceneFile(“UI_GameStart.json”);
this->addChild(node,0); //调用渲染UI代码
用了这个就有会中断我的调试,不知道怎么搞了。

http://www.cocoachina.com/bbs/read.php?tid=194668我按照这个网址来弄了,就是加载不了那个CocosGUI的头了!

用了但是出错了啊!

试试用UI的加载方式:12::12::12::12::12::12::12::12::12::12:

但是我加载不了CocosGUI.h,用不了啊!

include需要写明CocosGUI的路径。。
你看下源码。

好像是“cocostudio/CocosGUI.h"
前面部分不写是因为一般情况下VS设置里边有把那些路径添加到搜索目录

好的,谢谢!