APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx.scenes.scene2d.actions

public Class RunnableAction

extends Action
Class Inheritance
Imports
com.badlogic.gdx.scenes.scene2d.Action, com.badlogic.gdx.utils.Pool

An action that runs a Runnable. Alternatively, the run() method can be overridden instead of setting a runnable.
Author
Nathan Sweet

Field Summary

Modifier and TypeField and Description
private boolean
private Runnable
Inherited from com.badlogic.gdx.scenes.scene2d.Action:
actortarget

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
act(float delta)

Implements abstract com.badlogic.gdx.scenes.scene2d.Action.act.

Updates the action based on time.

public Runnable
public void
reset()

Overrides com.badlogic.gdx.scenes.scene2d.Action.reset.

Implements com.badlogic.gdx.utils.Pool.Poolable.reset.

Resets the optional state of this action to as if it were newly created, allowing the action to be pooled and reused.

public void
restart()

Overrides com.badlogic.gdx.scenes.scene2d.Action.restart.

Sets the state of the action so it can be run again.

public void
run()

Called to run the runnable.

public void
Inherited from com.badlogic.gdx.scenes.scene2d.Action:
getActorgetPoolgetTargetsetActorsetPoolsetTargettoString

Field Detail

ranback to summary
private boolean ran
runnableback to summary
private Runnable runnable

Constructor Detail

RunnableActionback to summary
public RunnableAction()

Method Detail

actback to summary
public boolean act(float delta)

Implements abstract com.badlogic.gdx.scenes.scene2d.Action.act.

Doc from com.badlogic.gdx.scenes.scene2d.Action.act.

Updates the action based on time. Typically this is called each frame by Actor#act(float).

getRunnableback to summary
public Runnable getRunnable()
resetback to summary
public void reset()

Overrides com.badlogic.gdx.scenes.scene2d.Action.reset.

Implements com.badlogic.gdx.utils.Pool.Poolable.reset.

Doc from com.badlogic.gdx.scenes.scene2d.Action.reset.

Resets 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 restart().

If a subclass has optional state, it must override this method, call super, and reset the optional state.

restartback to summary
public void restart()

Overrides com.badlogic.gdx.scenes.scene2d.Action.restart.

Doc from com.badlogic.gdx.scenes.scene2d.Action.restart.

Sets the state of the action so it can be run again.

runback to summary
public void run()

Called to run the runnable.

setRunnableback to summary
public void setRunnable(Runnable runnable)