Class EventAction<T extends Event>
java.lang.Object
com.prineside.tdi2.scene2d.Action
com.prineside.tdi2.scene2d.actions.EventAction<T>
- All Implemented Interfaces:
Pool.Poolable
- Direct Known Subclasses:
CountdownEventAction
Adds a listener to the actor for a specific event type and does not complete until
handle(Event) returns true.- Author:
- JavadocMD, Nathan Sweet
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanact(float delta) Updates the action based on time.abstract booleanCalled 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) voidSets the actor this action will manipulate.
-
Constructor Details
-
EventAction
-
-
Method Details
-
restart
public void restart()Description copied from class:ActionSets the state of the action so it can be run again. -
setTarget
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
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)
-