Class CCSpriteFrameCache

#include <Geode/cocos/sprite_nodes/CCSpriteFrameCache.h>
classCCSpriteFrameCache:publiccocos2d::CCObject{ ... }

Since v0.9

Singleton that handles the loading of the sprite frames. It saves in a cache the sprite frames.

Examples0
Public static methods3
staticcocos2d::CCSpriteFrameCache*sharedSpriteFrameCache()

Returns the shared instance of the Sprite Frame cache

staticcocos2d::CCSpriteFrameCache*get()
No description provided
staticvoidpurgeSharedSpriteFrameCache()

Purges the cache. It releases all the Sprite Frames and the retained instance.

Public member functions11
boolinit()
No description provided
voidaddSpriteFramesWithFile(
charconst*pszPlist
)

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.

voidaddSpriteFramesWithFile(,
charconst*textureFileName
)

Since v0.99.5

Adds multiple Sprite Frames from a plist file. The texture will be associated with the created sprite frames.

voidaddSpriteFramesWithFile(
charconst*pszPlist
,)

Adds multiple Sprite Frames from a plist file. The texture will be associated with the created sprite frames.

voidaddSpriteFrame(,
charconst*pszFrameName
)

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.

voidremoveSpriteFrames()

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.

voidremoveUnusedSpriteFrames()

Removes unused sprite frames. Sprite Frames that have a retain count of 1 will be deleted. It is convenient to call this method after when starting a new Scene.

voidremoveSpriteFrameByName(
charconst*pszName
)

Deletes an sprite frame from the sprite frame cache.

voidremoveSpriteFramesFromFile()

Since v0.99.5

Removes multiple Sprite Frames from a plist file. Sprite Frames stored in this file will be removed. It is convenient to call this method when a specific texture needs to be removed.

voidremoveSpriteFramesFromTexture()

Since v0.995.

Removes all Sprite Frames associated with the specified textures. It is convenient to call this method when a specific texture needs to be removed.

cocos2d::CCSpriteFrame*spriteFrameByName(
charconst*pszName
)

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.

Fields3
cocos2d::CCDictionary*m_pSpriteFrames
;
No description provided
cocos2d::CCDictionary*m_pSpriteFramesAliases
;
No description provided
std::set<gd::string>*m_pLoadedFileNames
;
No description provided
Protected member functions0
Protected fields0