Search code examples
cocos2d-iphonecocos2d-x

cocos2dx how to clear CCAnimationCache


In cocos2d-x, I cache the animation in CCAnimationCache. But how can I clear all the animation-cache?


Solution

  • You should try

    CCAnimationCache::sharedAnimationCache()->purgeSharedAnimationCache();
    

    It releases all the CCAnimation objects and the shared instance. Else you can also use

    removeAnimationByName("youAnimationName");
    

    this will remove particular animation you wish.

    Hope this helps you.. :)