How to Flip Sprite in Cocos2D ?

By | March 17, 2011

Hi,

On certain occasions you may need to flip the sprite you are using in your application.
There are two ways to flip a sprite. Let’s see how this can be done along X-direction
Method:1

mySprite.flipX = 180;

where mySprite is the name of your sprite you want to flip.

Method:2

CCFlipX *flipOnX = [CCFlipX actionWithFlipX:YES];
[mySprite runAction:flipOnX ];

where mySprite is the name of your sprite & flipOnX is the name of the CCFlipX action.

🙂 . You can try the Y-direction your own!

One thought on “How to Flip Sprite in Cocos2D ?

Leave a Reply

Your email address will not be published. Required fields are marked *