Class cc.AnimationCache

Class Summary
Constructor Attributes Constructor Name and Description
 

Singleton that manages the Animations.

Method Summary

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