在cocos2d中排队不同的命令(CCSequene)

时间:2011-07-21 09:20:58

标签: iphone xcode cocos2d-iphone queue

我正在尝试从屏幕上淡出标签,然后在完成之后将其从视图中删除。如何排队,以便视图在删除之前等待标签完全褪色?

id sequence = [CCSequence actions:[splashLabel runAction:[CCFadeOut actionWithDuration:0.5]], [self removeChild:splashLabel cleanup:YES], nil];
[self runAction:sequence];

1 个答案:

答案 0 :(得分:1)

    id fade=[CCFadeOut actionWithDuration:1.0f];





    id delay=[CCDelayTime actionWithDuration:0.2];




    id seqq=[CCSequence actions:fade,delay,nil];


    [splashLabel runAction:seqq];



        id stopAni=[splashLabel stopAllActions];

    id remove=[self removeChild:splashLabel cleanup:YES];








    [self runAction:[CCSequence actions:stopAni,remove,nil]];