【发布时间】:2013-01-26 08:07:43
【问题描述】:
在cocos2d-x中,我将动画缓存在CCAnimationCache中。但是我怎样才能清除所有的动画缓存呢?
【问题讨论】:
在cocos2d-x中,我将动画缓存在CCAnimationCache中。但是我怎样才能清除所有的动画缓存呢?
【问题讨论】:
你应该试试
CCAnimationCache::sharedAnimationCache()->purgeSharedAnimationCache();
它释放所有 CCAnimation 对象和共享实例。 否则你也可以使用
removeAnimationByName("youAnimationName");
这将删除您想要的特定动画。
希望这对你有帮助.. :)
【讨论】:
在 cocos2d 中,我们使用这些调用...在 cocos2d-x 中找到相同的 api
[[CCDirector sharedDirector] purgeCachedData];
[[CCTextureCache sharedTextureCache] removeAllTextures];
[CCTextureCache purgeSharedTextureCache];
[[CCSpriteFrameCache sharedSpriteFrameCache] removeSpriteFrames];
[CCSpriteFrameCache purgeSharedSpriteFrameCache];
【讨论】: