public class AnimationController extends java.lang.Object implements IAnimationController
Constructor and Description |
---|
AnimationController() |
AnimationController(Animation defaultAnimation) |
AnimationController(Animation defaultAnimation,
Animation... animations) |
AnimationController(Spritesheet sprite) |
AnimationController(Spritesheet sprite,
boolean loop) |
Modifier and Type | Method and Description |
---|---|
void |
add(Animation animation) |
void |
add(ImageEffect effect) |
void |
addListener(AnimationListener listener) |
void |
attach() |
protected java.lang.String |
buildCurrentCacheKey() |
void |
detach() |
java.awt.geom.AffineTransform |
getAffineTransform() |
Animation |
getAnimation(java.lang.String animationName) |
java.util.Collection<Animation> |
getAnimations() |
Animation |
getCurrentAnimation() |
java.awt.image.BufferedImage |
getCurrentSprite() |
java.awt.image.BufferedImage |
getCurrentSprite(int width,
int height) |
Animation |
getDefaultAnimation() |
java.util.List<ImageEffect> |
getImageEffects() |
boolean |
hasAnimation(java.lang.String animationName) |
boolean |
isPlaying(java.lang.String animationName) |
void |
playAnimation(java.lang.String animationName) |
void |
remove(Animation animation) |
void |
remove(ImageEffect effect) |
void |
removeListener(AnimationListener listener) |
void |
setAffineTransform(java.awt.geom.AffineTransform affineTransform) |
void |
setDefaultAnimation(Animation defaultAnimation) |
void |
update()
This method is called by the game loop on all objects that need to update
their attributes.
|
public AnimationController()
public AnimationController(Animation defaultAnimation)
public AnimationController(Spritesheet sprite)
public AnimationController(Spritesheet sprite, boolean loop)
public void add(Animation animation)
add
in interface IAnimationController
public void add(ImageEffect effect)
add
in interface IAnimationController
public void attach()
public void detach()
public void addListener(AnimationListener listener)
addListener
in interface IAnimationController
public void removeListener(AnimationListener listener)
removeListener
in interface IAnimationController
public java.awt.geom.AffineTransform getAffineTransform()
getAffineTransform
in interface IAnimationController
public java.util.Collection<Animation> getAnimations()
getAnimations
in interface IAnimationController
public Animation getAnimation(java.lang.String animationName)
getAnimation
in interface IAnimationController
public Animation getCurrentAnimation()
getCurrentAnimation
in interface IAnimationController
public java.awt.image.BufferedImage getCurrentSprite()
getCurrentSprite
in interface IAnimationController
public java.awt.image.BufferedImage getCurrentSprite(int width, int height)
getCurrentSprite
in interface IAnimationController
public Animation getDefaultAnimation()
getDefaultAnimation
in interface IAnimationController
public java.util.List<ImageEffect> getImageEffects()
getImageEffects
in interface IAnimationController
public boolean hasAnimation(java.lang.String animationName)
hasAnimation
in interface IAnimationController
public boolean isPlaying(java.lang.String animationName)
isPlaying
in interface IAnimationController
public void playAnimation(java.lang.String animationName)
playAnimation
in interface IAnimationController
public void remove(Animation animation)
remove
in interface IAnimationController
public void remove(ImageEffect effect)
remove
in interface IAnimationController
public void setDefaultAnimation(Animation defaultAnimation)
setDefaultAnimation
in interface IAnimationController
public void update()
IUpdateable
update
in interface IUpdateable
protected java.lang.String buildCurrentCacheKey()
public void setAffineTransform(java.awt.geom.AffineTransform affineTransform)
setAffineTransform
in interface IAnimationController