removeSpriteFramesFromFile和removeUnusedSpriteFrames有什么区别?

时间:2013-06-28 13:44:30

标签: caching cocos2d-iphone ccsprite sprite-sheet

我真的想了解并理解removeSpriteFramesFromFileremoveUnusedSpriteFrames之间的差异以及它们最适用的情况。

2 个答案:

答案 0 :(得分:1)

看起来是时候从cocos2d头文件中获取另一个copypaste了!

CCSpriteFrameCache.h

/** Removes unused sprite frames.
* Sprite Frames that have a retain count of 1 will be deleted.
* It is convinient to call this method after when starting a new Scene.
*/
-(void) removeUnusedSpriteFrames;

/** Removes multiple Sprite Frames from a plist file.
* Sprite Frames stored in this file will be removed.
* It is convinient to call this method when a specific texture needs to be removed.
* @since v0.99.5
*/
- (void) removeSpriteFramesFromFile:(NSString*) plist;

答案 1 :(得分:0)

removeSpriteFramesFromFile:

从plist文件中删除多个Sprite Frame。存储在此文件中的Sprite帧将被删除。当需要删除特定纹理时,调用此方法很方便。

removeUnusedSpriteFrames:

删除未使用的精灵帧。将删除保留计数为1的Sprite帧。在开始新场景后调用此方法很方便。