Singleton that manages the Animations. More...
#include <CCAnimationCache.h>
Public Member Functions | |
| AnimationCache () | |
| ~AnimationCache () | |
| bool | init (void) |
| void | addAnimation (Animation *animation, const char *name) |
| Adds a Animation with a name. More... | |
| void | removeAnimation (const char *name) |
| Deletes a Animation from the cache. More... | |
| CC_DEPRECATED_ATTRIBUTE void | removeAnimationByName (const char *name) |
| Animation * | getAnimation (const char *name) |
| Returns a Animation that was previously added. More... | |
| CC_DEPRECATED_ATTRIBUTE Animation * | animationByName (const char *name) |
| void | addAnimationsWithDictionary (Dictionary *dictionary) |
| Adds an animation from an NSDictionary Make sure that the frames were previously loaded in the SpriteFrameCache. More... | |
| void | addAnimationsWithFile (const char *plist) |
| Adds an animation from a plist file. More... | |
Public Member Functions inherited from Object | |
| Object () | |
| Constructor. More... | |
| virtual | ~Object () |
| void | release () |
| Release the ownership immediately. More... | |
| void | retain () |
| Retains the ownership. More... | |
| Object * | autorelease () |
| Release the ownership sometime soon automatically. More... | |
| bool | isSingleReference () const |
| Returns a boolean value that indicates whether there is only one reference to the object. More... | |
| unsigned int | retainCount () const |
| Returns the object's current reference count. More... | |
| virtual bool | isEqual (const Object *object) |
| Returns a boolean value that indicates whether this object and a given object are equal. More... | |
| virtual void | acceptVisitor (DataVisitor &visitor) |
| virtual void | update (float dt) |
Static Public Member Functions | |
| static AnimationCache * | getInstance () |
| Returns the shared instance of the Animation cache. More... | |
| local | getInstance () |
| Returns the shared instance of the Animation cache. More... | |
| static void | destroyInstance () |
| Purges the cache. More... | |
| local | destroyInstance () |
| Purges the cache. More... | |
| static CC_DEPRECATED_ATTRIBUTE AnimationCache * | sharedAnimationCache () |
| local | sharedAnimationCache () |
| static CC_DEPRECATED_ATTRIBUTE void | purgeSharedAnimationCache () |
| var | purgeSharedAnimationCache () |
| local | purgeSharedAnimationCache () |
Additional Inherited Members | |
Public Attributes inherited from Object | |
| unsigned int | _ID |
| object id, ScriptSupport need public _ID More... | |
| int | _luaID |
| Lua reference id. More... | |
Protected Attributes inherited from Object | |
| unsigned int | _reference |
| count of references More... | |
| var | _reference |
| count of references More... | |
| local | _reference |
| count of references More... | |
| unsigned int | _autoReleaseCount |
| count of autorelease More... | |
| var | _autoReleaseCount |
| count of autorelease More... | |
| local | _autoReleaseCount |
| count of autorelease More... | |
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 Sprite. Since v0.99.5, you should use this class instead.
| AnimationCache | ( | ) |
| var ctor | ( | ) |
| local AnimationCache | ( | ) |
| ~AnimationCache | ( | ) |
| var addAnimation | ( | var | animation, |
| var | name | ||
| ) |
Adds a Animation with a name.
| local addAnimation | ( | local | animation, |
| local | name | ||
| ) |
Adds a Animation with a name.
| void addAnimationsWithDictionary | ( | Dictionary * | dictionary) |
Adds an animation from an NSDictionary Make sure that the frames were previously loaded in the SpriteFrameCache.
| var addAnimationsWithDictionary | ( | var | dictionary) |
Adds an animation from an NSDictionary Make sure that the frames were previously loaded in the SpriteFrameCache.
| local addAnimationsWithDictionary | ( | local | dictionary) |
Adds an animation from an NSDictionary Make sure that the frames were previously loaded in the SpriteFrameCache.
| void addAnimationsWithFile | ( | const char * | plist) |
Adds an animation from a plist file.
Make sure that the frames were previously loaded in the SpriteFrameCache.
| var addAnimations | ( | var | plist) |
Adds an animation from a plist file.
Make sure that the frames were previously loaded in the SpriteFrameCache.
| local addAnimations | ( | local | plist) |
Adds an animation from a plist file.
Make sure that the frames were previously loaded in the SpriteFrameCache.
|
inline |
|
static |
Purges the cache.
It releases all the Animation objects and the shared instance.
|
static |
Purges the cache.
It releases all the Animation objects and the shared instance.
|
static |
Purges the cache.
It releases all the Animation objects and the shared instance.
| Animation* getAnimation | ( | const char * | name) |
Returns a Animation 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.
| var getAnimation | ( | var | name) |
Returns a Animation 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.
| local getAnimation | ( | local | name) |
Returns a Animation 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.
|
static |
Returns the shared instance of the Animation cache.
|
static |
Returns the shared instance of the Animation cache.
|
static |
Returns the shared instance of the Animation cache.
| bool init | ( | void | ) |
| var init | ( | ) |
| local init | ( | ) |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
| void removeAnimation | ( | const char * | name) |
Deletes a Animation from the cache.
| var removeAnimation | ( | var | name) |
Deletes a Animation from the cache.
| local removeAnimation | ( | local | name) |
Deletes a Animation from the cache.
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |