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

public abstract Class DelegateAction

extends Action
Class Inheritance
Known Direct Subclasses
com.badlogic.gdx.scenes.scene2d.actions.RepeatAction, com.badlogic.gdx.scenes.scene2d.actions.TimeScaleAction, com.badlogic.gdx.scenes.scene2d.actions.AfterAction, com.badlogic.gdx.scenes.scene2d.actions.DelayAction
Imports
com.badlogic.gdx.scenes.scene2d.Action, .Actor, com.badlogic.gdx.utils.Pool

Base class for an action that wraps another action.
Author
Nathan Sweet

Field Summary

Modifier and TypeField and Description
protected Action
Inherited from com.badlogic.gdx.scenes.scene2d.Action:
actortarget

Constructor Summary

AccessConstructor and Description
public

Method Summary

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

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

Updates the action based on time.

protected abstract boolean
delegate(float delta)

public Action
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
setAction(Action action)

Sets the wrapped action.

public void
setActor(Actor actor)

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

Sets the actor this action is attached to.

public void
setTarget(Actor target)

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

Sets the actor this action will manipulate.

public String
toString()

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

Returns a string representation of the object.

Inherited from com.badlogic.gdx.scenes.scene2d.Action:
getActorgetPoolgetTargetsetPool

Field Detail

actionback to summary
protected Action action

Constructor Detail

DelegateActionback to summary
public DelegateAction()

Method Detail

actback to summary
public final 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).

delegateback to summary
protected abstract boolean delegate(float delta)
getActionback to summary
public Action getAction()
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.

setActionback to summary
public void setAction(Action action)

Sets the wrapped action.

setActorback to summary
public void setActor(Actor actor)

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

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

Sets the actor this action is attached to. This also sets the target actor if it is null. This method is called automatically when an action is added to an actor. This method is also called with null when an action is removed from an actor.

When set to null, if the action has a pool then the action is returned to the pool (which calls reset()) and the pool is set to null. If the action does not have a pool, reset() is not called.

This method is not typically a good place for an action subclass to query the actor's state because the action may not be executed for some time, eg it may be delayed. The actor's state is best queried in the first call to act(float). For a TemporalAction, use TemporalAction#begin().

setTargetback to summary
public void setTarget(Actor target)

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

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

Sets the actor this action will manipulate. If no target actor is set, setActor(Actor) will set the target actor when the action is added to an actor.

toStringback to summary
public String toString()

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

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.