1.第一个参数是要替换的图片,第二个参数是要替换为的图片
CCSpriteFrameCache::sharedSpriteFrameCache()->replaceFrameByName("ani_special_boss_disappear_popup.png","ani_special_boss_disappear_popup01.png");
2.用完不要忘记替换回来
CCSpriteFrameCache::sharedSpriteFrameCache()->replaceFrameByName("ani_special_boss_disappear_popup01.png","ani_special_boss_disappear_popup.png");
原文链接:https://www.f2er.com/cocos2dx/338332.html