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()
Attach the
AnimationController, as well as all its Animations to the Game loop. |
protected java.lang.String |
buildCurrentCacheKey()
Build a unique cache key for the current frame.
|
void |
clear()
Remove all
Animations from the AnimationController. |
void |
detach()
Detach the
AnimationController, as well as all its Animations from the Game loop. |
Animation |
get(java.lang.String animationName) |
java.awt.geom.AffineTransform |
getAffineTransform() |
java.util.Collection<Animation> |
getAll() |
Animation |
getCurrent() |
java.awt.image.BufferedImage |
getCurrentSprite() |
java.awt.image.BufferedImage |
getCurrentSprite(int width,
int height) |
Animation |
getDefault() |
java.util.List<ImageEffect> |
getImageEffects() |
boolean |
hasAnimation(java.lang.String animationName) |
boolean |
isEnabled() |
boolean |
isPlaying(java.lang.String animationName) |
void |
play(java.lang.String animationName) |
void |
remove(Animation animation) |
void |
remove(ImageEffect effect) |
void |
removeListener(AnimationListener listener) |
void |
setAffineTransform(java.awt.geom.AffineTransform affineTransform) |
void |
setDefault(Animation defaultAnimation) |
void |
setEnabled(boolean enabled) |
void |
update()
This method is called by the game loop on all objects that are attached to the loop.
|
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(ImageEffect effect)
add in interface IAnimationControllerpublic void addListener(AnimationListener listener)
addListener in interface IAnimationControllerpublic void attach()
AnimationController, as well as all its Animations to the Game loop.ILooppublic void clear()
IAnimationControllerAnimations from the AnimationController.clear in interface IAnimationControllerpublic void detach()
AnimationController, as well as all its Animations from the Game loop.ILooppublic Animation get(java.lang.String animationName)
get in interface IAnimationControllerpublic java.awt.geom.AffineTransform getAffineTransform()
getAffineTransform in interface IAnimationControllerpublic java.util.Collection<Animation> getAll()
getAll in interface IAnimationControllerpublic Animation getCurrent()
getCurrent 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 getDefault()
getDefault in interface IAnimationControllerpublic java.util.List<ImageEffect> getImageEffects()
getImageEffects in interface IAnimationControllerpublic boolean hasAnimation(java.lang.String animationName)
hasAnimation in interface IAnimationControllerpublic boolean isEnabled()
isEnabled in interface IAnimationControllerpublic boolean isPlaying(java.lang.String animationName)
isPlaying in interface IAnimationControllerpublic void play(java.lang.String animationName)
play in interface IAnimationControllerpublic void remove(Animation animation)
remove in interface IAnimationControllerpublic void remove(ImageEffect effect)
remove in interface IAnimationControllerpublic void removeListener(AnimationListener listener)
removeListener in interface IAnimationControllerpublic void setAffineTransform(java.awt.geom.AffineTransform affineTransform)
setAffineTransform in interface IAnimationControllerpublic void setDefault(Animation defaultAnimation)
setDefault in interface IAnimationControllerpublic void setEnabled(boolean enabled)
setEnabled in interface IAnimationControllerpublic void update()
IUpdateableClientConfiguration.update in interface IUpdateableClientConfiguration.setMaxFps(int)protected java.lang.String buildCurrentCacheKey()
hashCode, the current keyframe's sprite index, as well as all applied ImageEffects' names, are considered when determining the current cache key.