Friday, 31 May 2013

How to call a sprite by tag: cocos2d

In cocos2d, you can call a sprite by it's tag. This can be done as follows:

Syntax:

      CCSprite *tempSprite =  (CCSprite *)[self getChildByTag:tagValue];

Example:

      CCSprite *tempSprite =  (CCSprite *)[self getChildByTag:10];

No comments:

Post a Comment