Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pulse animation on iPhone

Using cocos2d, how can I achieve a pulse animation using actions.

I know I'll need CCScaleTo and probably CCRepeat, but I don't know how to put them together.

like image 749
James Webster Avatar asked Mar 21 '26 14:03

James Webster


1 Answers

Just for the sake of completeness in addition to James' spot on answer above, you need to call the method [runAction ...] on your CCNode object and pass it the action - That is, the code provided by James as is.

To stop the pulsating effect, you can call [stopAllActions ...] on your CCNode.

Best,

like image 170
Loic Argelies Avatar answered Mar 24 '26 09:03

Loic Argelies



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!