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(IImageEffect effect) |
void |
attach() |
protected java.lang.String |
buildCurrentCacheKey() |
void |
detach() |
java.awt.geom.AffineTransform |
getAffineTransform() |
Animation |
getAnimation(java.lang.String animationName) |
java.util.List<Animation> |
getAnimations() |
Animation |
getCurrentAnimation() |
java.awt.image.BufferedImage |
getCurrentSprite() |
java.awt.image.BufferedImage |
getCurrentSprite(int width,
int height) |
Animation |
getDefaultAnimation() |
java.util.List<IImageEffect> |
getImageEffects() |
boolean |
hasAnimation(java.lang.String animationName) |
boolean |
isPlaying(java.lang.String animationName) |
void |
onPlayback(java.util.function.Consumer<Animation> cons) |
void |
onPlaybackEnded(java.util.function.Consumer<Animation> cons) |
void |
playAnimation(java.lang.String animationName) |
void |
remove(Animation animation) |
void |
remove(IImageEffect effect) |
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 IAnimationControllerpublic void add(IImageEffect effect)
add in interface IAnimationControllerpublic void attach()
public void detach()
public java.awt.geom.AffineTransform getAffineTransform()
getAffineTransform in interface IAnimationControllerpublic java.util.List<Animation> getAnimations()
getAnimations in interface IAnimationControllerpublic Animation getAnimation(java.lang.String animationName)
getAnimation in interface IAnimationControllerpublic Animation getCurrentAnimation()
getCurrentAnimation in interface IAnimationControllerpublic java.awt.image.BufferedImage getCurrentSprite()
getCurrentSprite in interface IAnimationControllerpublic java.awt.image.BufferedImage getCurrentSprite(int width,
int height)
getCurrentSprite in interface IAnimationControllerpublic Animation getDefaultAnimation()
getDefaultAnimation in interface IAnimationControllerpublic java.util.List<IImageEffect> getImageEffects()
getImageEffects in interface IAnimationControllerpublic boolean hasAnimation(java.lang.String animationName)
hasAnimation in interface IAnimationControllerpublic boolean isPlaying(java.lang.String animationName)
isPlaying in interface IAnimationControllerpublic void onPlayback(java.util.function.Consumer<Animation> cons)
onPlayback in interface IAnimationControllerpublic void onPlaybackEnded(java.util.function.Consumer<Animation> cons)
onPlaybackEnded in interface IAnimationControllerpublic void playAnimation(java.lang.String animationName)
playAnimation in interface IAnimationControllerpublic void remove(Animation animation)
remove in interface IAnimationControllerpublic void remove(IImageEffect effect)
remove in interface IAnimationControllerpublic void setDefaultAnimation(Animation defaultAnimation)
setDefaultAnimation in interface IAnimationControllerpublic void update()
IUpdateableupdate in interface IUpdateableprotected java.lang.String buildCurrentCacheKey()
public void setAffineTransform(java.awt.geom.AffineTransform affineTransform)
setAffineTransform in interface IAnimationController