今天遇到个蛋疼的问题
我用cocos2dx 2.2.2
然后 用UI编辑器 制作了个动画
然后 导出 GameOver.ExportJson
然后 我在代码 中
UILayer *pGameOverUI = UILayer::create();
gui::Layout pGameOverLayout = dynamic_cast<Layout>(GUIReader::shareReader()->widgetFromJsonFile(“GameUI/GameOver/GameOver.ExportJson”));
pGameOverUI->addWidget(pGameOverLayout);
ActionManager::shareManager()->playActionByName(“GameUI/GameOver/GameOver.ExportJson”, “OverAction”);
this->addChild(pGameOverUI);
这样调用
但 死活不播放 动画
是不是 接口用错了
然后 我用
CCArmatureDataManager::sharedArmatureDataManager()->addArmatureFileInfo(“GameUI/GameOver/GameOver.ExportJson”);
CCArmature *pGameOverArm = CCArmature::create(“OverAction”);
pGameOverArm->setPosition(VisibleRect::center());
if (pGameOverArm->getAnimation() != NULL)
{
pGameOverArm->getAnimation()->play(“OverAction”);
}
都不行
CCArmature *pGameOverArm = CCArmature::create(“OverAction”);
这句找不到动画名字
问题是 生成的ExportJson文件 我根本不知道 动画名字是什么
附件有 我的 ExportJson 文件
求大神不怜指导