UILayer *layer = UILayer::create();
layer->addWidget(GUIReader::shareReader()>widgetFromJsonFile(“button.ExportJson”));
this->addchild(layer);
float a = layer->getChildByTag(4)->getPositionY();
CCLOG(“Position:%f”,a);
上述代码为什么不能获取button的位置啊,程序中断出错,求解
PS:
1.cocos版本2.2.2
2.可以在scene中显示,但不能获取位置