cocos2d-x
2.2.3-gd2.113-rev1ec524e
|
Singleton that manages the Animations. More...
#include <CCAnimationCache.h>
Public Member Functions | |
CCAnimationCache () | |
ctor More... | |
~CCAnimationCache () | |
NA NA. More... | |
void | addAnimation (CCAnimation *animation, const char *name) |
Adds a CCAnimation with a name. More... | |
void | removeAnimationByName (const char *name) |
Deletes a CCAnimation from the cache. More... | |
CCAnimation * | animationByName (const char *name) |
Returns a CCAnimation that was previously added. More... | |
void | addAnimationsWithDictionary (CCDictionary *dictionary, const char *plist=NULL) |
Adds an animation from an NSDictionary Make sure that the frames were previously loaded in the CCSpriteFrameCache. More... | |
void | addAnimationsWithFile (const char *plist) |
Adds an animation from a plist file. More... | |
bool | init (void) |
![]() | |
CCObject (void) | |
virtual | ~CCObject (void) |
NA. More... | |
void | release (void) |
void | retain (void) |
CCObject * | autorelease (void) |
CCObject * | copy (void) |
bool | isSingleReference (void) const |
unsigned int | retainCount (void) const |
virtual bool | isEqual (const CCObject *pObject) |
virtual void | acceptVisitor (CCDataVisitor &visitor) |
virtual void | update (float dt) |
CCObject (const CCObject &) | |
CCObject & | operator= (const CCObject &) |
virtual void | encodeWithCoder (DS_Dictionary *) |
virtual bool | canEncode () |
CCObjectType | getObjType () const |
virtual int | getTag () const |
virtual void | setTag (int nTag) |
void | setObjType (CCObjectType) |
![]() | |
virtual CCObject * | copyWithZone (CCZone *pZone) |
Static Public Member Functions | |
static CCAnimationCache * | sharedAnimationCache (void) |
Returns the shared instance of the Animation cache getInstance. More... | |
static void | purgeSharedAnimationCache (void) |
Purges the cache. More... | |
![]() | |
static CCObject * | createWithCoder (DS_Dictionary *) |
Additional Inherited Members | |
![]() | |
unsigned int | m_uID |
int | m_nLuaID |
![]() | |
unsigned int | m_uReference |
unsigned int | m_uAutoReleaseCount |
int | m_nTag |
int | m_eObjType |
unsigned int | m_uObjectIdxInArray |
Singleton that manages the Animations.
It saves in a cache the animations. You should use this class if you want to save your animations in a cache.
Before v0.99.5, the recommend way was to save them on the CCSprite. Since v0.99.5, you should use this class instead.
CCAnimationCache | ( | ) |
ctor
~CCAnimationCache | ( | ) |
NA NA.
void addAnimation | ( | CCAnimation * | animation, |
const char * | name | ||
) |
Adds a CCAnimation with a name.
void addAnimationsWithDictionary | ( | CCDictionary * | dictionary, |
const char * | plist = NULL |
||
) |
Adds an animation from an NSDictionary Make sure that the frames were previously loaded in the CCSpriteFrameCache.
plist | The path of the relative file,it use to find the plist path for load SpriteFrames. |
void addAnimationsWithFile | ( | const char * | plist | ) |
Adds an animation from a plist file.
Make sure that the frames were previously loaded in the CCSpriteFrameCache.
CCAnimation * animationByName | ( | const char * | name | ) |
Returns a CCAnimation 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. getAnimation
bool init | ( | void | ) |
|
static |
Purges the cache.
It releases all the CCAnimation objects and the shared instance.
void removeAnimationByName | ( | const char * | name | ) |
Deletes a CCAnimation from the cache.
removeAnimation
|
static |
Returns the shared instance of the Animation cache getInstance.