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

public Class ParallelAction

extends Action
Class Inheritance
Known Direct Subclasses
com.badlogic.gdx.scenes.scene2d.actions.SequenceAction
Imports
com.badlogic.gdx.scenes.scene2d.Action, .Actor, com.badlogic.gdx.utils.Array, .Pool

Executes a number of actions at the same time.
Author
Nathan Sweet

Field Summary

Modifier and TypeField and Description
pack-priv Array<Action>
private boolean
Inherited from com.badlogic.gdx.scenes.scene2d.Action:
actortarget

Constructor Summary

AccessConstructor and Description
public
public
public
ParallelAction(Action action1, Action action2)

public
ParallelAction(Action action1, Action action2, Action action3)

public
ParallelAction(Action action1, Action action2, Action action3, Action action4)

public
ParallelAction(Action action1, Action action2, Action action3, Action action4, Action action5)

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 void
addAction(Action action)

public Array<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
setActor(Actor actor)

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

Sets the actor this action is attached to.

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:
getActorgetPoolgetTargetsetPoolsetTarget

Field Detail

actionsback to summary
pack-priv Array<Action> actions
completeback to summary
private boolean complete

Constructor Detail

ParallelActionback to summary
public ParallelAction()
ParallelActionback to summary
public ParallelAction(Action action1)
ParallelActionback to summary
public ParallelAction(Action action1, Action action2)
ParallelActionback to summary
public ParallelAction(Action action1, Action action2, Action action3)
ParallelActionback to summary
public ParallelAction(Action action1, Action action2, Action action3, Action action4)
ParallelActionback to summary
public ParallelAction(Action action1, Action action2, Action action3, Action action4, Action action5)

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).

addActionback to summary
public void addAction(Action action)
getActionsback to summary
public Array<Action> getActions()
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.

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

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.