Class cc.AnimationCache
Extends
cc.Class.
Defined in: CCAnimationCache.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Singleton that manages the Animations. |
Method Attributes | Method Name and Description |
---|---|
addAnimation(animation, name)
Adds a cc.Animation with a name.
|
|
addAnimations(plist)
Adds an animation from a plist file. |
|
addAnimationsWithDictionary(dictionary)
Adds an animation from an NSDictionary |
|
getAnimation(name)
Returns a cc.Animation that was previously added. |
|
<static> |
cc.AnimationCache.getInstance()
Retruns ths shared instance of the Animation cache
|
init()
initialize cc.AnimationCache
|
|
<static> |
cc.AnimationCache.purgeSharedAnimationCache()
Purges the cache.
|
removeAnimation(name)
Deletes a cc.Animation from the cache.
|
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.
cc.AnimationCache.getInstance().addAnimation(animation,"animation1");
- Parameters:
- {cc.Animation} animation
- {String} name
Adds an animation from a plist file.
Make sure that the frames were previously loaded in the cc.SpriteFrameCache.
- Parameters:
- {String} plist
Adds an animation from an NSDictionary
Make sure that the frames were previously loaded in the cc.SpriteFrameCache.
- Parameters:
- {object} dictionary
Returns a cc.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.
- Parameters:
- {String} name
- Returns:
- {cc.Animation}
- Returns:
- {cc.AnimationCache}
- Returns:
- {Boolean}
- Parameters:
- {String} name