Search code examples
core-animationcocos2d-iphone

animate images in cocos2d


I am newbie in cocos2D But have developed several view based application. So what I want to know is:

Is there any alternate ,for animationImages used for animating the images in imageview, in cocos2D?

I want to use the same thing i.e: Animate the images same as any gif file.

Thanks in advance....


Solution

  • Animation in Cocos2D is handled by the CCAnimation class, you can read the documentation here:

    http://www.cocos2d-iphone.org/api-ref/latest-stable/interface_c_c_animation.html

    There are a number of examples for animating sprites, using a Sprite Sheet, single Images, a Texture Cache, etc.

    This is one of my favorite ones:

    http://www.raywenderlich.com/1271/how-to-use-animations-and-sprite-sheets-in-cocos2d