auto uiLayer = UILayer::create();
auto myLayout = GUIReader::shareReader()->widgetFromJsonFile(“MYUI.ExportJson”);
uiLayer->addWidget(myLayout);
this->addChild(uiLayer, 0);
老版本是这样的,3.0正式版,提示没有UILayer这个类了
auto uiLayer = UILayer::create();
auto myLayout = GUIReader::shareReader()->widgetFromJsonFile(“MYUI.ExportJson”);
uiLayer->addWidget(myLayout);
this->addChild(uiLayer, 0);
老版本是这样的,3.0正式版,提示没有UILayer这个类了
自己顶一下
周末没有人加班啊~
那也应该要有人逛论坛啊





难道大家没有遇到这个问题吗
顶一下,希望能得到解决
3.0的 我是直接加在场景上就好了 不用再创建一个层
竟然是挖坟。。。
Layout* layout = static_cast<Layout*>(cocostudio::GUIReader::getInstance()->widgetFromJsonFile("ui/mainUI_1.ExportJson"));
addChild(layout);
Button *finiteModelButton = static_cast<Button*>(layout->getChildByName("button_w"));
Button *gateModelButton = static_cast<Button*>(layout->getChildByName("button_c"));
finiteModelButton->addTouchEventListener(this, toucheventselector(MainScene::onInfiniteModelStart));
gateModelButton->addTouchEventListener(this,toucheventselector(MainScene::onGateModelStart));
#include “cocostudio/CCSGUIReader.h”
Layer ul = Layer::create();
addChild(ul);
auto myLayerOut = dynamic_cast<Layout>(GUIReader::getInstance()->widgetFromJsonFile("./LoginLayer/DemoLogin.json"));
ul->addChild(myLayerOut);