How do i simply change a sprite's image in cocos2d?

后端 未结 7 1332
逝去的感伤
逝去的感伤 2021-02-14 18:28

I\'ve tried

[[CCTextureCache sharedTextureCache] addImage: @\"still.png\"];

But I always end up with a distorted image for some reason. It\'s m

7条回答
  •  礼貌的吻别
    2021-02-14 19:05

    In cocos2d v3, I was able to accomplish this with...

    [mySprite setSpriteFrame:[CCSpriteFrame frameWithImageNamed:@"two.png"]]
    

    ...but I have no idea if this has side effects that will hurt me in the long run. :)

提交回复
热议问题