#import <CCSpriteFrameCache.h>
Public Member Functions | |
| (void) | - addSpriteFramesWithDictionary:texture: |
| (void) | - addSpriteFramesWithFile: |
| (void) | - addSpriteFramesWithFile:texture: |
| (void) | - addSpriteFrame:name: |
| (void) | - removeSpriteFrames |
| (void) | - removeUnusedSpriteFrames |
| (void) | - removeSpriteFrameByName: |
| (CCSpriteFrame *) | - spriteFrameByName: |
| (CCSprite *) | - createSpriteWithFrameName: |
Static Public Member Functions | |
| (CCSpriteFrameCache *) | + sharedSpriteFrameCache |
| (void) | + purgeSharedSpriteFrameCache |
Singleton that handles the loading of the sprite frames. It saves in a cache the sprite frames.
Definition at line 33 of file CCSpriteFrameCache.h.
| - (void) addSpriteFrame: | (CCSpriteFrame *) | frame | ||
| name: | (NSString *) | frameName | ||
Adds an sprite frame with a given name. If the name already exists, then the contents of the old name will be replaced with the new one.
| - (void) addSpriteFramesWithDictionary: | (NSDictionary *) | dictionary | ||
| texture: | (CCTexture2D *) | texture | ||
Adds multiple Sprite Frames with a dictionary. The texture will be associated with the created sprite frames.
| - (void) addSpriteFramesWithFile: | (NSString *) | plist |
Adds multiple Sprite Frames from a plist file. A texture will be loaded automatically. The texture name will composed by replacing the .plist suffix with .png If you want to use another texture, you should use the addSpriteFramesWithFile:texture method.
| - (void) addSpriteFramesWithFile: | (NSString *) | plist | ||
| texture: | (CCTexture2D *) | texture | ||
Adds multiple Sprite Frames from a plist file. The texture will be associated with the created sprite frames.
| - (CCSprite*) createSpriteWithFrameName: |
Creates an sprite with the name of an sprite frame. The created sprite will contain the texture, rect and offset of the sprite frame. It returns an autorelease object.
| + (void) purgeSharedSpriteFrameCache |
Purges the cache. It releases all the Sprite Frames and the retained instance.
| - (void) removeSpriteFrameByName: | (NSString *) | name |
Deletes an sprite frame from the sprite frame cache.
| - (void) removeSpriteFrames |
Purges the dictionary of loaded sprite frames. Call this method if you receive the "Memory Warning". In the short term: it will free some resources preventing your app from being killed. In the medium term: it will allocate more resources. In the long term: it will be the same.
| - (void) removeUnusedSpriteFrames |
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.
| + (CCSpriteFrameCache *) sharedSpriteFrameCache |
Retruns ths shared instance of the Sprite Frame cache
| - (CCSpriteFrame*) spriteFrameByName: | (NSString *) | name |
Returns an Sprite Frame that was previously added. If the name is not found it will return nil. You should retain the returned copy if you are going to use it.