Class cc.animationCache

Class Summary
Constructor Attributes Constructor Name and Description
 

cc.animationCache is a singleton object that manages the Animations.

Method Summary

Class Detail

cc.animationCache()

cc.animationCache is a singleton object 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.

example
cc.animationCache.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 animations from a plist file.
    Make sure that the frames were previously loaded in the cc.SpriteFrameCache.

    Parameters:
    {String} plist
  • {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}
  • removeAnimation(name)
    Deletes a cc.Animation from the cache.
    Parameters:
    {String} name