Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simultaneous CCActions Cocos2d

Is it possible to run multiple ccactions on a sprite at the same time? For example, if I have a CCFadeIn, a CCScaleTo, and a CCRotateBy, all with the same duration, can I run all three on a sprite at the same time? The only thing I have found that does anything remotely close is CCSequence, and that's not what I want. Thanks!

like image 831
eric.mitchell Avatar asked Nov 09 '11 22:11

eric.mitchell


1 Answers

You don't need to use CCSpawn, just run these actions individually on the same sprite and they will run concurrently:

id fadeIn = [CCFadeIn actionWith…];
[sprite runAction:fadeIn];

id scale = [CCScaleTo actionWith…];
[sprite runAction:scale];

id rotate = [CCRotateBy actionWith…];
[sprite runAction:rotate];
like image 60
LearnCocos2D Avatar answered Sep 27 '22 18:09

LearnCocos2D