eric.mitchell
eric.mitchell

Reputation: 8855

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!

Upvotes: 10

Views: 6084

Answers (2)

CodeSmile
CodeSmile

Reputation: 64477

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];

Upvotes: 22

ScottPetit
ScottPetit

Reputation: 814

Just use CCSpawn, if you've used CCSequence you should automatically know how to use CCSpawn.

Upvotes: 11

Related Questions