Change button image at runtime in cocos2d
I am creating a button with CCMenuItem in cocos2d. I want the button image to be 开发者_运维技巧change whenever i tap it. Is there anyway to do that at runtime.
Thanks
When creating a CCMenuItemSprite you can specify normal and selected sprite. Just specify them:
CCMenuItemSprite *item = [CCMenuItemSprite itemFromNormalSprite:@"1.png" selectedSprite:@"2.png" target:self selector:@selector(foo)];
精彩评论