Class RunnableAction
- java.lang.Object
-
- com.badlogic.gdx.scenes.scene2d.Action
-
- com.badlogic.gdx.scenes.scene2d.actions.RunnableAction
-
- All Implemented Interfaces:
Pool.Poolable
public class RunnableAction extends Action
An action that runs aRunnable. Alternatively, therun()method can be overridden instead of setting a runnable.
-
-
Constructor Summary
Constructors Constructor Description RunnableAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanact(float delta)Updates the action based on time.java.lang.RunnablegetRunnable()voidreset()Resets the optional state of this action to as if it were newly created, allowing the action to be pooled and reused.voidrestart()Sets the state of the action so it can be run again.voidrun()Called to run the runnable.voidsetRunnable(java.lang.Runnable runnable)
-
-
-
Method Detail
-
act
public boolean act(float delta)
Description copied from class:ActionUpdates the action based on time. Typically this is called each frame byActor.act(float).
-
run
public void run()
Called to run the runnable.
-
restart
public void restart()
Description copied from class:ActionSets the state of the action so it can be run again.
-
reset
public void reset()
Description copied from class:ActionResets the optional state of this action to as if it were newly created, allowing the action to be pooled and reused. State required to be set for every usage of this action or computed during the action does not need to be reset.The default implementation calls
Action.restart().If a subclass has optional state, it must override this method, call super, and reset the optional state.
- Specified by:
resetin interfacePool.Poolable- Overrides:
resetin classAction
-
getRunnable
public java.lang.Runnable getRunnable()
-
setRunnable
public void setRunnable(java.lang.Runnable runnable)
-
-