Ios Cocos2dx:如何按顺序播放精灵帧动画

Ios Cocos2dx:如何按顺序播放精灵帧动画,ios,cocos2d-x,cocos2d-x-3.0,Ios,Cocos2d X,Cocos2d X 3.0,我有一个大的sprite表是8192*8192,它不支持cocos2dx。因此,我分为3个部分,每个4096*4096。但我如何按顺序运行sprite表中的那个些呢 这是我的部分代码。我是cocos2dx的新手 cocos2d::SpriteFrameCache* cache_1 = cocos2d::SpriteFrameCache::getInstance(); cache_1->addSpriteFramesWithFile("cutSceneTexture_1.plist"); /

我有一个大的sprite表是8192*8192,它不支持cocos2dx。因此,我分为3个部分,每个4096*4096。但我如何按顺序运行sprite表中的那个些呢

这是我的部分代码。我是cocos2dx的新手

cocos2d::SpriteFrameCache* cache_1 = cocos2d::SpriteFrameCache::getInstance();
cache_1->addSpriteFramesWithFile("cutSceneTexture_1.plist");
// same for cache_2 and cache_3 ...

SpriteBatchNode* spritebatch_1 = SpriteBatchNode::create("cutSceneTexture_1.png");
// same for spritebatch_2, and spritebatch_3 ...

Sprite* spriteFrameOne = Sprite::createWithSpriteFrameName("InfectionAnimation1.png");
spriteFrameOne->setPosition(cocos2d::Point(visibleSize.width/2, visibleSize.height/2));
spritebatch_1->addChild(spriteFrameOne);
this->addChild(spritebatch_1, 5);
// same for spriteFrameTwo and spriteFrameThree but different frameName...

cocos2d::Vector<SpriteFrame*> animFrames_1(18);
cocos2d::Vector<SpriteFrame*> animFrames_2(18);
cocos2d::Vector<SpriteFrame*> animFrames_3(18);

char str[100] = {0};

for(int i = 1; i <= 18; i++)
{
    sprintf(str, "InfectionAnimation%d.png", i);
    SpriteFrame* frame = cache_1->getSpriteFrameByName( str );
    animFrames_1.pushBack(frame);
}
// ... same for animFrames_2 and animFrames_3

auto animation_1 = Animation::createWithSpriteFrames(animFrames_1, 0.08f);
auto animate_1 = Animate::create(animation_1);
auto animation_2 = Animation::createWithSpriteFrames(animFrames_2, 0.08f);
auto animate_2 = Animate::create(animation_2);
auto animation_3 = Animation::createWithSpriteFrames(animFrames_3, 0.08f);
auto animate_3 = Animate::create(animation_3);

// Question: how to make those three sprite frame animations run in sequence??
spriteFrameOne->runAction(animate_1);
spriteFrameTwo->runAction(animate_2);
spriteFrameThree->runAction(animate_3);    

谢谢

加载所有3个atlas plists,然后像以前一样使用帧,cocos2d会自动从右侧纹理Atlasy拾取它们。您应该使用一个精灵节点来播放动画_1、动画_2和动画_3的序列。@LearnCos2D感谢您的回答。如果可能的话,你能做一个简单的演示吗?我是cocos2dx的新手。谢谢@盖伊·科格斯谢谢你的回答。如果可能的话,你能做一个简单的演示吗?我是cocos2dx的新手。谢谢我习惯于cocos2d-xv2.x,而不是3.x,但我猜调用可能类似于spriteFrame->runActionSequence::createanimate_1,animate_2,animate_3,nullptr;