|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.badlogic.gdx.scenes.scene2d.Action
public abstract class Action
Actions attach to an Actor
and perform some task, often over time.
Field Summary | |
---|---|
protected Actor |
actor
The actor this action is attached to, or null if it is not attached. |
Constructor Summary | |
---|---|
Action()
|
Method Summary | |
---|---|
abstract boolean |
act(float delta)
Updates the action based on time. |
Actor |
getActor()
|
Pool |
getPool()
|
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 |
setActor(Actor actor)
Sets the actor this action will be used for. |
void |
setPool(Pool pool)
Sets the pool that the action will be returned to when removed from the actor. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Actor actor
Constructor Detail |
---|
public Action()
Method Detail |
---|
public abstract boolean act(float delta)
Actor.act(float)
.
delta
- Time in seconds since the last frame.
public void restart()
public Actor getActor()
public void setActor(Actor actor)
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 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
act(float)
. For a TemporalAction
, use TemporalAction#begin().
public void reset()
The default implementation calls restart()
.
If a subclass has optional state, it must override this method, call super, and reset the optional state.
reset
in interface Pool.Poolable
public Pool getPool()
public void setPool(Pool pool)
setActor(Actor)
public java.lang.String toString()
toString
in class java.lang.Object
|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |