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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
act
(float delta) Updates the action based on time.abstract boolean
Called when the specific type of event occurs on the actor.boolean
isActive()
void
restart()
Sets the state of the action so it can be run again.void
setActive
(boolean active) void
Sets the actor this action will manipulate.
-
Constructor Details
-
EventAction
-
-
Method Details
-
restart
public void restart()Description copied from class:Action
Sets the state of the action so it can be run again. -
setTarget
Description copied from class:Action
Sets 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
handled
and this EventAction considered complete.
-
act
public boolean act(float delta) Description copied from class:Action
Updates the action based on time. Typically this is called each frame byActor.act(float)
. -
isActive
public boolean isActive() -
setActive
public void setActive(boolean active)
-