cocos2d

CCTexture2D* tex = [[CCTextureCache sharedTextureCache] addImage:@"new_image_name"];
[spriteWant2Change setTexture: tex];

what to do if texture is different in size from previous one ?

If the sprites are of different size then you will need to do this after calling setTexture function 

[spriteWant2Change setTextureRect:CGRectMake(0, 0, tex.contentSize.width, tex.contentSize.height)];

摘自:Stack Overflow

原文地址:https://www.cnblogs.com/ihojin/p/change-image-of-sprite.html