cocos2d-x  2.2.3-gd2.113-rev1ec524e
Loading...
Searching...
No Matches
CCAnimationCache Class Reference

Singleton that manages the Animations. More...

#include <CCAnimationCache.h>

Inheritance diagram for CCAnimationCache:
[legend]
Collaboration diagram for CCAnimationCache:
[legend]

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...
 
CCAnimationanimationByName (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)
 
- Public Member Functions inherited from CCObject
 CCObject (void)
 
virtual ~CCObject (void)
 NA. More...
 
void release (void)
 
void retain (void)
 
CCObjectautorelease (void)
 
CCObjectcopy (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 &)
 
CCObjectoperator= (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)
 
- Public Member Functions inherited from CCCopying
virtual CCObjectcopyWithZone (CCZone *pZone)
 

Static Public Member Functions

static CCAnimationCachesharedAnimationCache (void)
 Returns the shared instance of the Animation cache getInstance. More...
 
static void purgeSharedAnimationCache (void)
 Purges the cache. More...
 
- Static Public Member Functions inherited from CCObject
static CCObjectcreateWithCoder (DS_Dictionary *)
 

Additional Inherited Members

- Public Attributes inherited from CCObject
unsigned int m_uID
 
int m_nLuaID
 
- Protected Attributes inherited from CCObject
unsigned int m_uReference
 
unsigned int m_uAutoReleaseCount
 
int m_nTag
 
int m_eObjType
 
unsigned int m_uObjectIdxInArray
 

Detailed Description

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.

Since
v0.99.5

Constructor & Destructor Documentation

◆ CCAnimationCache()

ctor

◆ ~CCAnimationCache()

NA NA.

Member Function Documentation

◆ addAnimation()

void addAnimation ( CCAnimation animation,
const char *  name 
)

Adds a CCAnimation with a name.

◆ addAnimationsWithDictionary()

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.

Parameters
plistThe path of the relative file,it use to find the plist path for load SpriteFrames.
Since
v1.1

◆ addAnimationsWithFile()

void addAnimationsWithFile ( const char *  plist)

Adds an animation from a plist file.

Make sure that the frames were previously loaded in the CCSpriteFrameCache.

Since
v1.1 addAnimations

◆ animationByName()

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

◆ init()

bool init ( void  )

◆ purgeSharedAnimationCache()

static void purgeSharedAnimationCache ( void  )
static

Purges the cache.

It releases all the CCAnimation objects and the shared instance.

◆ removeAnimationByName()

void removeAnimationByName ( const char *  name)

Deletes a CCAnimation from the cache.

removeAnimation

◆ sharedAnimationCache()

static CCAnimationCache * sharedAnimationCache ( void  )
static

Returns the shared instance of the Animation cache getInstance.


The documentation for this class was generated from the following file: