APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx.scenes.scene2d.actions

public abstract Class EventAction<T extends Event>

extends Action
Class Inheritance
Known Direct Subclasses
com.badlogic.gdx.scenes.scene2d.actions.CountdownEventAction
Imports
com.badlogic.gdx.scenes.scene2d.Action, .Actor, .Event, .EventListener, com.badlogic.gdx.utils.reflect.ClassReflection

Adds a listener to the actor for a specific event type and does not complete until handle(Event) returns true.
Authors
JavadocMD, Nathan Sweet

Field Summary

Modifier and TypeField and Description
pack-priv boolean
pack-priv final Class<? extends T>
private final EventListener
pack-priv boolean
Inherited from com.badlogic.gdx.scenes.scene2d.Action:
actortarget

Constructor Summary

AccessConstructor and Description
public
EventAction(Class<? extends T> eventClass)

Method Summary

Modifier and TypeMethod and Description
public boolean
act(float delta)

Implements abstract com.badlogic.gdx.scenes.scene2d.Action.act.

Updates the action based on time.

public abstract boolean

Returns:

true if the event should be considered handled and this EventAction considered complete.
handle
(T event)

Called when the specific type of event occurs on the actor.

public boolean
public void
restart()

Overrides com.badlogic.gdx.scenes.scene2d.Action.restart.

Sets the state of the action so it can be run again.

public void
setActive(boolean active)

public void
setTarget(Actor newTarget)

Overrides com.badlogic.gdx.scenes.scene2d.Action.setTarget.

Sets the actor this action will manipulate.

Inherited from com.badlogic.gdx.scenes.scene2d.Action:
getActorgetPoolgetTargetresetsetActorsetPooltoString

Field Detail

activeback to summary
pack-priv boolean active
eventClassback to summary
pack-priv final Class<? extends T> eventClass
listenerback to summary
private final EventListener listener
resultback to summary
pack-priv boolean result

Constructor Detail

EventActionback to summary
public EventAction(Class<? extends T> eventClass)

Method Detail

actback to summary
public boolean act(float delta)

Implements abstract com.badlogic.gdx.scenes.scene2d.Action.act.

Doc from com.badlogic.gdx.scenes.scene2d.Action.act.

Updates the action based on time. Typically this is called each frame by Actor#act(float).

handleback to summary
public abstract boolean handle(T event)

Called when the specific type of event occurs on the actor.

Returns:boolean

true if the event should be considered handled and this EventAction considered complete.

isActiveback to summary
public boolean isActive()
restartback to summary
public void restart()

Overrides com.badlogic.gdx.scenes.scene2d.Action.restart.

Doc from com.badlogic.gdx.scenes.scene2d.Action.restart.

Sets the state of the action so it can be run again.

setActiveback to summary
public void setActive(boolean active)
setTargetback to summary
public void setTarget(Actor newTarget)

Overrides com.badlogic.gdx.scenes.scene2d.Action.setTarget.

Doc from com.badlogic.gdx.scenes.scene2d.Action.setTarget.

Sets the actor this action will manipulate. If no target actor is set, setActor(Actor) will set the target actor when the action is added to an actor.