Class EventAction<T extends Event>
- java.lang.Object
-
- com.badlogic.gdx.scenes.scene2d.Action
-
- com.badlogic.gdx.scenes.scene2d.actions.EventAction<T>
-
- All Implemented Interfaces:
Pool.Poolable
- Direct Known Subclasses:
CountdownEventAction
public abstract class EventAction<T extends Event> extends Action
Adds a listener to the actor for a specific event type and does not complete untilhandle(Event)returns true.
-
-
Constructor Summary
Constructors Constructor Description EventAction(java.lang.Class<? extends T> eventClass)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanact(float delta)Updates the action based on time.abstract booleanhandle(T event)Called when the specific type of event occurs on the actor.booleanisActive()voidrestart()Sets the state of the action so it can be run again.voidsetActive(boolean active)voidsetTarget(Actor newTarget)Sets the actor this action will manipulate.
-
-
-
Constructor Detail
-
EventAction
public EventAction(java.lang.Class<? extends T> eventClass)
-
-
Method Detail
-
restart
public void restart()
Description copied from class:ActionSets the state of the action so it can be run again.
-
setTarget
public void setTarget(Actor newTarget)
Description copied from class:ActionSets the actor this action will manipulate. If no target actor is set,Action.setActor(Actor)will set the target actor when the action is added to an actor.
-
handle
public abstract boolean handle(T event)
Called when the specific type of event occurs on the actor.- Returns:
- true if the event should be considered
handledand this EventAction considered complete.
-
act
public boolean act(float delta)
Description copied from class:ActionUpdates the action based on time. Typically this is called each frame byActor.act(float).
-
isActive
public boolean isActive()
-
setActive
public void setActive(boolean active)
-
-