bool HelloWorld::init()
{
// xxxxxxxxx
auto ui = GUIReader::getInstance()->widgetFromJsonFile("sceneCover.json");
this->addChild(ui);
Button* temp = static_cast<Button*>(Helper::seekWidgetByName(ui, “easyBtn”));
temp->setPosition(Vec2(400, 400));
// xxxxxxxxxxx
return true;
}
如上述代码,我在helloworld这个类的init函数中,添加了在cocostudio创建的UI文件,解析显示正常,但是当我想将解析出来的按钮,自定义点位的时候,发现设置万之后,界面上没有任何变化,还是从json读取时候的点位;求大神帮忙看一下,这个奇葩的问题。话说没人遇到过这种问题么?
版本: cocos2dx-3.2
cocostudio 1.6.0.0