Class PropAnimationController<T extends Prop>
java.lang.Object
de.gurkenlabs.litiengine.graphics.animation.AnimationController
de.gurkenlabs.litiengine.graphics.animation.EntityAnimationController<T>
de.gurkenlabs.litiengine.graphics.animation.PropAnimationController<T>
- All Implemented Interfaces:
IEntityController,IAnimationController,IEntityAnimationController<T>,IUpdateable
-
Nested Class Summary
Nested classes/interfaces inherited from class de.gurkenlabs.litiengine.graphics.animation.EntityAnimationController
EntityAnimationController.AnimationRule<T extends IEntity> -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPropAnimationController(T prop) Initializes a new instance of thePropAnimationControllerclass. -
Method Summary
Modifier and TypeMethodDescriptionGets the current sprite (keyframe) of the currently active animation of this controller.static StringgetSpriteName(Prop prop, boolean appendState) Gets the sprite name for the specified prop and state.static StringgetSpriteName(Prop prop, PropState state, boolean appendState) Gets the sprite name for the specified prop and state.booleanGets a flag indicating whether this controller instance is auto scaling its animations by the dimensions of the entity.voidupdate()This method is called by the game loop on all objects that are attached to the loop.Methods inherited from class de.gurkenlabs.litiengine.graphics.animation.EntityAnimationController
addRule, addRule, getDefaultSpritePrefixes, getEntity, getSpritePrefix, scaleSprite, scaleSprite, setAutoScaling, setSpritePrefixMethods inherited from class de.gurkenlabs.litiengine.graphics.animation.AnimationController
add, add, addListener, attach, buildCurrentCacheKey, clear, detach, flipAnimation, get, getAffineTransform, getAll, getCurrent, getCurrentImage, getDefault, getImageEffects, hasAnimation, isEnabled, isPlaying, play, remove, remove, removeListener, setAffineTransform, setDefault, setEnabledMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.gurkenlabs.litiengine.graphics.animation.IAnimationController
add, add, addListener, clear, get, getAffineTransform, getAll, getCurrent, getCurrentImage, getDefault, getImageEffects, hasAnimation, isEnabled, isPlaying, play, remove, remove, removeListener, setAffineTransform, setDefault, setEnabledMethods inherited from interface de.gurkenlabs.litiengine.entities.IEntityController
attach, detach
-
Field Details
-
PROP_IDENTIFIER
- See Also:
-
-
Constructor Details
-
PropAnimationController
Initializes a new instance of thePropAnimationControllerclass.- Parameters:
prop- The prop related to this controller.
-
-
Method Details
-
getSpriteName
Gets the sprite name for the specified prop and state.- Parameters:
prop- The prop to retrieve the sprite name for.appendState- A flag indicating whether the state should be appended to the name.- Returns:
- A string representing the sprite name for the specified prop in its state.
- See Also:
-
getSpriteName
Gets the sprite name for the specified prop and state.- Parameters:
prop- The prop to retrieve the sprite name for.state- The state of the prop.appendState- A flag indicating whether the state should be appended to the name.- Returns:
- A string representing the sprite name for the specified prop in its state.
- See Also:
-
getCurrentImage
Description copied from interface:IAnimationControllerGets the current sprite (keyframe) of the currently active animation of this controller.The implementation of this method applies all registered
ImageEffects.- Specified by:
getCurrentImagein interfaceIAnimationController- Overrides:
getCurrentImagein classAnimationController- Returns:
- The current sprite of the current animation with applied effects; or null, if this controller is currently disabled.
- See Also:
-
update
public void update()Description copied from interface:IUpdateableThis method is called by the game loop on all objects that are attached to the loop. It's called on every tick of the loop and the frequency can be configured using theClientConfiguration.- Specified by:
updatein interfaceIUpdateable- Overrides:
updatein classEntityAnimationController<T extends Prop>- See Also:
-
isAutoScaling
public boolean isAutoScaling()Description copied from interface:IEntityAnimationControllerGets a flag indicating whether this controller instance is auto scaling its animations by the dimensions of the entity.- Specified by:
isAutoScalingin interfaceIEntityAnimationController<T extends Prop>- Overrides:
isAutoScalingin classEntityAnimationController<T extends Prop>- Returns:
- True if this instance is automatically scaling to the dimensions of the entity; otherwise false.
-