Class AnimationController

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

public class AnimationController
extends java.lang.Object
implements IAnimationController
  • Constructor Summary

    Constructors 
    ConstructorDescription
    AnimationController()
    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.
    AnimationController​(Spritesheet sprite)
    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 TypeMethodDescription
    voidadd​(Animation animation)
    Add the specified Animation to this controller instance.
    voidadd​(ImageEffect effect)
    Adds the specified ImageEffect to be applied when the current image is retrieved from this controller.
    voidaddListener​(AnimationListener listener)
    Adds the specified animation listener to receive events and callbacks when animation playbacks are started and finished.
    voidattach()
    Attach the AnimationController, as well as all its Animations to the Game loop.
    protected java.lang.StringbuildCurrentCacheKey()
    Build a unique cache key for the current frame.
    voidclear()
    Remove all Animations from the AnimationController.
    voiddetach()
    Detach the AnimationController, as well as all its Animations from the Game loop.
    static AnimationflipAnimation​(Animation anim, java.lang.String newSpriteName) 
    Animationget​(java.lang.String animationName)
    Gets the Animation instance with the specified name from this controller.
    java.awt.geom.AffineTransformgetAffineTransform()
    Gets the AffineTransform instance assigned to this controller that can be used to externally transform the current image when rendering it with the ImageRenderer.
    java.util.Collection<Animation>getAll()
    Gets all Animation instances managed by this controller.
    AnimationgetCurrent()
    Gets the currently active Animation of this controller.
    java.awt.image.BufferedImagegetCurrentImage()
    Gets the current sprite (keyframe) of the currently active animation of this controller.
    java.awt.image.BufferedImagegetCurrentImage​(int width, int height)
    Gets the current sprite scaled by the specified dimensions of the currently active animation of this controller.
    AnimationgetDefault()
    Gets the default Animation of this controller.
    java.util.List<ImageEffect>getImageEffects()
    Gets all image effects assigned to this controller.
    booleanhasAnimation​(java.lang.String animationName)
    Determines whether this controller has an Animation with the specified name.
    booleanisEnabled()
    Determines whether this controller is currently enabled.
    booleanisPlaying​(java.lang.String animationName)
    Determines whether this controller is currently playing an Animation with the specified name.
    voidplay​(java.lang.String animationName)
    Plays the Animation with the specified name.
    voidremove​(Animation animation)
    Removes the specified Animation from this controller instance.
    voidremove​(ImageEffect effect)
    Removes the specified ImageEffect from this controller.
    voidremoveListener​(AnimationListener listener)
    Removes the specified animation listener.
    voidsetAffineTransform​(java.awt.geom.AffineTransform affineTransform)
    Sets the AffineTransform instance for this controller that can be used to externally transform the current image when rendering it with the ImageRenderer.
    voidsetDefault​(Animation defaultAnimation)
    Sets the specified Animation as default for this controller.
    voidsetEnabled​(boolean enabled)
    Sets a flag that defines whether this controller is enabled or not.
    voidupdate()
    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