public class EntityAnimationController<T extends IEntity> extends AnimationController implements IEntityAnimationController
| Constructor and Description |
|---|
EntityAnimationController(T entity) |
EntityAnimationController(T entity,
Animation defaultAnimation,
Animation... animations) |
EntityAnimationController(T entity,
Spritesheet sprite) |
EntityAnimationController(T entity,
Spritesheet sprite,
boolean loop) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAnimationRule(java.util.function.Predicate<IEntity> rule,
java.util.function.Function<IEntity,java.lang.String> animationName)
Registers an animation rule that will be evaluated if there is currently no
animation playing that is defined to loop.
|
static <T> java.lang.String[] |
getDefaultSpritePrefixes(java.lang.Class<T> cls) |
T |
getEntity() |
protected java.lang.String |
getSpritePrefix() |
boolean |
isAutoScaling() |
void |
scaleSprite(float scale) |
void |
scaleSprite(float scaleX,
float scaleY) |
void |
setAutoScaling(boolean scaling) |
protected void |
setSpritePrefix(java.lang.String prefix) |
void |
update()
This method is called by the game loop on all objects that need to update
their attributes.
|
add, add, attach, buildCurrentCacheKey, detach, getAffineTransform, getAnimation, getAnimations, getCurrentAnimation, getCurrentSprite, getCurrentSprite, getDefaultAnimation, getImageEffects, hasAnimation, isPlaying, onPlayback, onPlaybackEnded, playAnimation, remove, remove, setAffineTransform, setDefaultAnimationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadd, add, getAffineTransform, getAnimation, getAnimations, getCurrentAnimation, getCurrentSprite, getCurrentSprite, getDefaultAnimation, getImageEffects, hasAnimation, isPlaying, onPlayback, onPlaybackEnded, playAnimation, remove, remove, setAffineTransform, setDefaultAnimationattach, detachpublic EntityAnimationController(T entity)
public EntityAnimationController(T entity, Animation defaultAnimation, Animation... animations)
public EntityAnimationController(T entity, Spritesheet sprite)
public EntityAnimationController(T entity, Spritesheet sprite, boolean loop)
public static <T> java.lang.String[] getDefaultSpritePrefixes(java.lang.Class<T> cls)
public void addAnimationRule(java.util.function.Predicate<IEntity> rule, java.util.function.Function<IEntity,java.lang.String> animationName)
IEntityAnimationControlleraddAnimationRule in interface IEntityAnimationControllerrule - The rule that must be fulfilled for the animation to be appliedanimationName - The callback that evaluates the actual animation name that will be
appliedpublic T getEntity()
getEntity in interface IEntityProviderpublic void update()
IUpdateableupdate in interface IUpdateableupdate in class AnimationControllerprotected java.lang.String getSpritePrefix()
protected void setSpritePrefix(java.lang.String prefix)
public boolean isAutoScaling()
isAutoScaling in interface IEntityAnimationControllerpublic void setAutoScaling(boolean scaling)
setAutoScaling in interface IEntityAnimationControllerpublic void scaleSprite(float scaleX,
float scaleY)
scaleSprite in interface IEntityAnimationControllerpublic void scaleSprite(float scale)
scaleSprite in interface IEntityAnimationController