Package com.simsilica.lemur.anim
Class AnimationState
java.lang.Object
com.jme3.app.state.BaseAppState
com.simsilica.lemur.anim.AnimationState
- All Implemented Interfaces:
AppState
Manages a list of Animation tasks, calling them each once
per frame until done or canceled.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a TweenAnimation from the specified tween or tweens.<T extends Animation>
Tadd(T anim) Begins executing the specified animation.voidCancels a currently running animation.protected voidcleanup(Application app) Called after the app state is detached or during application shutdown if the state is still attached.static AnimationStateReturns the default animation state instance.protected voidinitialize(Application app) Called during initialization once the app state is attached and before onEnable() is called.booleanReturns true if the specified animation object is currently running, ie: will be executed this frame.protected voidCalled when the state was previously enabled but is now disabled either because setEnabled(false) was called or the state is being cleaned up.protected voidonEnable()Called when the state is fully enabled, ie: is attached and isEnabled() is true or when the setEnabled() status changes after the state is attached.protected voidvoidupdate(float tpf) Called to update theAppState.Methods inherited from class com.jme3.app.state.BaseAppState
cleanup, getApplication, getId, getState, getState, getState, getState, getStateManager, initialize, isEnabled, isInitialized, postRender, render, setEnabled, setId, stateAttached, stateDetached
-
Field Details
-
NANOS_TO_SECONDS
public static final double NANOS_TO_SECONDS- See Also:
-
-
Constructor Details
-
AnimationState
public AnimationState()
-
-
Method Details
-
getDefaultInstance
Returns the default animation state instance. -
isRunning
Returns true if the specified animation object is currently running, ie: will be executed this frame. -
add
Begins executing the specified animation. The passed animation is returned directly to the caller. -
add
Creates a TweenAnimation from the specified tween or tweens. If more than one Tween is passed then they are wrapped in a sequence. -
cancel
Cancels a currently running animation. -
remove
-
initialize
Description copied from class:BaseAppStateCalled during initialization once the app state is attached and before onEnable() is called.- Specified by:
initializein classBaseAppState- Parameters:
app- the application
-
cleanup
Description copied from class:BaseAppStateCalled after the app state is detached or during application shutdown if the state is still attached. onDisable() is called before this cleanup() method if the state is enabled at the time of cleanup.- Specified by:
cleanupin classBaseAppState- Parameters:
app- the application
-
onEnable
protected void onEnable()Description copied from class:BaseAppStateCalled when the state is fully enabled, ie: is attached and isEnabled() is true or when the setEnabled() status changes after the state is attached.- Specified by:
onEnablein classBaseAppState
-
update
public void update(float tpf) Description copied from interface:AppStateCalled to update theAppState. This method will be called every render pass if theAppStateis both attached and enabled.- Specified by:
updatein interfaceAppState- Overrides:
updatein classBaseAppState- Parameters:
tpf- Time since the last call to update(), in seconds.
-
onDisable
protected void onDisable()Description copied from class:BaseAppStateCalled when the state was previously enabled but is now disabled either because setEnabled(false) was called or the state is being cleaned up.- Specified by:
onDisablein classBaseAppState
-