Changing the image of a CCSprite

后端 未结 11 1917
离开以前
离开以前 2020-12-24 12:12

I have created a number of CCSprites using spriteWithFile.

How do I change the image for the sprite during runtime?

I need to change a few sprites images qui

11条回答
  •  伪装坚强ぢ
    2020-12-24 12:45

    For those who are using Cocos2d-iPhone v 3.0.0 or later

    demonSprite.texture = [[CCSprite spriteWithImageNamed:@"steelDemonNormal.png"] texture];
    

提交回复
热议问题