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
public class PropAnimationController<T extends Prop>
extends EntityAnimationController<T>Nested Class Summary
Nested classes/interfaces inherited from class de.gurkenlabs.litiengine.graphics.animation.EntityAnimationController
EntityAnimationController.AnimationRule<T extends IEntity>Field Summary
Fields Modifier and Type Field Description static java.lang.StringPROP_IDENTIFIERConstructor Summary
Constructors Constructor Description PropAnimationController(T prop)Initializes a new instance of thePropAnimationControllerclass.Method Summary
Modifier and Type Method Description java.awt.image.BufferedImagegetCurrentImage()Gets the current sprite (keyframe) of the currently active animation of this controller.static java.lang.StringgetSpriteName(Prop prop, boolean appendState)Gets the sprite name for the specified prop and state.static java.lang.StringgetSpriteName(Prop prop, PropState state, boolean appendState)Gets the sprite name for the specified prop and state.booleanisAutoScaling()Gets 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, setEnabled
Field Details
PROP_IDENTIFIER
public static final java.lang.String PROP_IDENTIFIER- See Also:
- Constant Field Values
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:
Prop.getSpritesheetName(),Prop.getState()
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:
Prop.getSpritesheetName(),Prop.getState()
getCurrentImage
public java.awt.image.BufferedImage 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:
IAnimationController.getCurrent(),Animation.getCurrentKeyFrame(),IAnimationController.isEnabled()
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:
ClientConfiguration.setMaxFps(int)
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.
