public class EntityAnimationController<T extends IEntity> extends AnimationController implements IEntityAnimationController<T>
| Modifier and Type | Class and Description |
|---|---|
protected static class |
EntityAnimationController.AnimationRule<T extends IEntity> |
| 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 |
addRule(java.util.function.Predicate<? super T> rule,
java.util.function.Function<? super T,java.lang.String> animationName)
Registers an animation rule that will be evaluated if there is currently no
animation playing that is defined to loop.
|
void |
addRule(java.util.function.Predicate<? super T> rule,
java.util.function.Function<? super T,java.lang.String> animationName,
int priority) |
static java.lang.String[] |
getDefaultSpritePrefixes(java.lang.Class<?> 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 are attached to the loop.
|
add, add, addListener, attach, buildCurrentCacheKey, clear, detach, get, getAffineTransform, getAll, getCurrent, getCurrentSprite, getCurrentSprite, getDefault, getImageEffects, hasAnimation, isEnabled, isPlaying, play, remove, remove, removeListener, setAffineTransform, setDefault, setEnabledclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadd, add, addListener, clear, get, getAffineTransform, getAll, getCurrent, getCurrentSprite, getCurrentSprite, getDefault, getImageEffects, hasAnimation, isEnabled, isPlaying, play, remove, remove, removeListener, setAffineTransform, setDefault, setEnabledattach, 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 java.lang.String[] getDefaultSpritePrefixes(java.lang.Class<?> cls)
public void addRule(java.util.function.Predicate<? super T> rule, java.util.function.Function<? super T,java.lang.String> animationName, int priority)
addRule in interface IEntityAnimationController<T extends IEntity>public void addRule(java.util.function.Predicate<? super T> rule, java.util.function.Function<? super T,java.lang.String> animationName)
IEntityAnimationControlleraddRule in interface IEntityAnimationController<T extends IEntity>rule - 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 IEntityControllerpublic void update()
IUpdateableClientConfiguration.update in interface IUpdateableupdate in class AnimationControllerClientConfiguration.setMaxFps(int)protected java.lang.String getSpritePrefix()
protected void setSpritePrefix(java.lang.String prefix)
public boolean isAutoScaling()
isAutoScaling in interface IEntityAnimationController<T extends IEntity>public void setAutoScaling(boolean scaling)
setAutoScaling in interface IEntityAnimationController<T extends IEntity>public void scaleSprite(float scaleX,
float scaleY)
scaleSprite in interface IEntityAnimationController<T extends IEntity>public void scaleSprite(float scale)
scaleSprite in interface IEntityAnimationController<T extends IEntity>