Class Index | File Index

Classes


Class cc.AnimationCache


Extends cc.Class.

Defined in: CCAnimationCache.js.

Class Summary
Constructor Attributes Constructor Name and Description
 

Singleton that manages the Animations.

Method Summary
Method Attributes Method Name and Description
 
addAnimation(animation, name)
Adds a cc.Animation with a name.
 

Adds an animation from a plist file.

 

Adds an animation from an NSDictionary
Make sure that the frames were previously loaded in the cc.SpriteFrameCache.

 

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.
 
Deletes a cc.Animation from the cache.
Class Detail
cc.AnimationCache()

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");
Method Detail
addAnimation(animation, name)
Adds a cc.Animation with a name.
Parameters:
{cc.Animation} animation
{String} name

addAnimations(plist)

Adds an animation from a plist file.
Make sure that the frames were previously loaded in the cc.SpriteFrameCache.

Parameters:
{String} plist

addAnimationsWithDictionary(dictionary)

Adds an animation from an NSDictionary
Make sure that the frames were previously loaded in the cc.SpriteFrameCache.

Parameters:
{object} dictionary

{cc.Animation} getAnimation(name)

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}

<static> {cc.AnimationCache} cc.AnimationCache.getInstance()
Retruns ths shared instance of the Animation cache
Returns:
{cc.AnimationCache}

{Boolean} init()
initialize cc.AnimationCache
Returns:
{Boolean}

<static> cc.AnimationCache.purgeSharedAnimationCache()
Purges the cache. It releases all the cc.Animation objects and the shared instance.

removeAnimation(name)
Deletes a cc.Animation from the cache.
Parameters:
{String} name

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Jan 09 2013 07:51:50 GMT-0800 (PST)