使用是Cocos2dx的spine4.0运行时,播放逻辑如下:
SkeletonAnimation* node = SkeletonAnimation::createWithJsonFile("xingtai1_0602.json", "xingtai1_0602.atlas");
if(!node)
{
return;
}
node->setPosition(Vec2(1000,450));
node->setAnchorPoint(Vec2(0.5,0.5));
addChild(node, 2);
float delayTime = 2;
node->setAnimation(0, "idle", true);
node->addAnimation(0, "dazhangji", true, delayTime);
node->addAnimation(0, "shuijiao", true, delayTime);
node->addAnimation(0, "idle", true, delayTime);