Friday, 31 May 2013

How to reset the image of a sprite: cocos2d

Cocos2d allows the programmer to reset the image of a sprite when needed. This can be done with the help of following code:




Syntax:

    [spriteName setTexture:[[CCTextureCache sharedTextureCache]
                                           addImage:@"newImageName.png"]];

No comments:

Post a Comment