Class AnimationController

java.lang.Object
de.gurkenlabs.litiengine.graphics.animation.AnimationController
All Implemented Interfaces:
IAnimationController, IUpdateable
Direct Known Subclasses:
EntityAnimationController

public class AnimationController extends Object implements IAnimationController
  • Constructor Summary

    Constructors
    Constructor
    Description
    Initializes a new instance of the AnimationController class.
    AnimationController(Animation defaultAnimation)
    Initializes a new instance of the AnimationController class with the specified default animation.
    AnimationController(Animation defaultAnimation, Animation... animations)
    Initializes a new instance of the AnimationController class with the specified default animation.
    Initializes a new instance of the AnimationController class with the specified default animation.
    AnimationController(Spritesheet sprite, boolean loop)
    Initializes a new instance of the AnimationController class with the specified default animation.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(Animation animation)
    Add the specified Animation to this controller instance.
    void
    add(ImageEffect effect)
    Adds the specified ImageEffect to be applied when the current image is retrieved from this controller.
    void
    Adds the specified animation listener to receive events and callbacks when animation playbacks are started and finished.
    void
    Attach the AnimationController, as well as all its Animations to the Game loop.
    protected String
    Build a unique cache key for the current frame.
    void
    Remove all Animations from the AnimationController.
    void
    Detach the AnimationController, as well as all its Animations from the Game loop.
    static Animation
    flipAnimation(Animation anim, String newSpriteName)
     
    get(String animationName)
    Gets the Animation instance with the specified name from this controller.
    Gets the AffineTransform instance assigned to this controller that can be used to externally transform the current image when rendering it with the ImageRenderer.
    Gets all Animation instances managed by this controller.
    Gets the currently active Animation of this controller.
    Gets the current sprite (keyframe) of the currently active animation of this controller.
    getCurrentImage(int width, int height)
    Gets the current sprite scaled by the specified dimensions of the currently active animation of this controller.
    Gets the default Animation of this controller.
    Gets all image effects assigned to this controller.
    boolean
    hasAnimation(String animationName)
    Determines whether this controller has an Animation with the specified name.
    boolean
    Determines whether this controller is currently enabled.
    boolean
    isPlaying(String animationName)
    Determines whether this controller is currently playing an Animation with the specified name.
    void
    play(String animationName)
    Plays the Animation with the specified name.
    void
    remove(Animation animation)
    Removes the specified Animation from this controller instance.
    void
    Removes the specified ImageEffect from this controller.
    void
    Removes the specified animation listener.
    void
    Sets the AffineTransform instance for this controller that can be used to externally transform the current image when rendering it with the ImageRenderer.
    void
    setDefault(Animation defaultAnimation)
    Sets the specified Animation as default for this controller.
    void
    setEnabled(boolean enabled)
    Sets a flag that defines whether this controller is enabled or not.
    void
    This method is called by the game loop on all objects that are attached to the loop.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait