|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.badlogic.gdx.scenes.scene2d.Action
com.badlogic.gdx.scenes.scene2d.actions.DelegateAction
public abstract class DelegateAction
Base class for an action that wraps another action.
Constructor Summary | |
---|---|
DelegateAction()
|
Method Summary | |
---|---|
boolean |
act(float delta)
Updates the action based on time. |
Action |
getAction()
|
void |
reset()
Resets the optional state of this action to as if it were newly created, allowing the action to be pooled and reused. |
void |
restart()
Sets the state of the action so it can be run again. |
void |
setAction(Action action)
Sets the wrapped action. |
void |
setActor(Actor actor)
Sets the actor this action will be used for. |
String |
toString()
|
Methods inherited from class com.badlogic.gdx.scenes.scene2d.Action |
---|
getActor, getPool, setPool |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DelegateAction()
Method Detail |
---|
public void setAction(Action action)
public Action getAction()
public final boolean act(float delta)
Action
Actor.act(float)
.
act
in class Action
delta
- Time in seconds since the last frame.
public void restart()
Action
restart
in class Action
public void reset()
Action
The default implementation calls Action.restart()
.
If a subclass has optional state, it must override this method, call super, and reset the optional state.
reset
in interface Pool.Poolable
reset
in class Action
public void setActor(Actor actor)
Action
pool
then the action is returned
to the pool (which calls Action.reset()
) and the pool is set to null.
If the action does not have a pool, Action.reset()
is not called.
This method is not typically a good place for a 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
Action.act(float)
. For a TemporalAction
, use TemporalAction#begin().
setActor
in class Action
public String toString()
toString
in class Action
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |