在helloWorldScene.cpp添加了如下代码,记载tespCpp中显示正常的骨骼动画资源,但是在我的helloWorldScene工程中显示的非常奇怪,如图,这该如何解决?
void HelloWorld::onEnter()
{
Layer::onEnter();
this->myTest();
}
void HelloWorld::myTest()
{
ArmatureDataManager::getInstance()->addArmatureFileInfoAsync("Cowboy.ExportJson", this, CC_SCHEDULE_SELECTOR(HelloWorld::onLoaded));
}
void HelloWorld::onLoaded(float percent)
{
log("%f", percent);
if (percent >= 1)
{
Armature *armature = Armature::create("Cowboy");
armature->getAnimation()->playWithIndex(0);
armature->setPosition(300, 150);
armature->setScale(0.2f);
addChild(armature);
}
}
```