Class SceneEvent

java.lang.Object
arc.scene.event.SceneEvent
All Implemented Interfaces:
Pool.Poolable
Direct Known Subclasses:
ChangeListener.ChangeEvent, FocusListener.FocusEvent, InputEvent, SceneResizeEvent, VisibilityEvent

public class SceneEvent extends Object implements Pool.Poolable
The base class for all events.

By default an event will "bubble" up through an element's parent's handlers.

An element's capture listeners can stop() an event to prevent child elements from seeing it.

An Event may be marked as "handled" which will end its propagation outside of the Stage (see handle()). The default Element.fire(SceneEvent) will mark events handled if an EventListener returns true.

A cancelled event will be stopped and handled. Additionally, many elements will undo the side-effects of a canceled event. (See cancel().)

See Also:
  • Field Details

    • targetActor

      public Element targetActor
    • listenerActor

      public Element listenerActor
    • capture

      public boolean capture
    • bubbles

      public boolean bubbles
    • handled

      public boolean handled
    • stopped

      public boolean stopped
    • cancelled

      public boolean cancelled
  • Constructor Details

    • SceneEvent

      public SceneEvent()
  • Method Details

    • handle

      public void handle()
      Marks this event as handled. This does not affect event propagation inside scene2d, but causes the Scene event methods to return true, which will eat the event so it is not passed on to the application under the stage.
    • cancel

      public void cancel()
      Marks this event cancelled. This handles the event and stops the event propagation. It also cancels any default action that would have been taken by the code that fired the event. Eg, if the event is for a checkbox being checked, cancelling the event could uncheck the checkbox.
    • stop

      public void stop()
      Marks this event has being stopped. This halts event propagation.
    • reset

      public void reset()
      Description copied from interface: Pool.Poolable
      Resets the object for reuse. Object references should be nulled and fields may be set to default values.
      Specified by:
      reset in interface Pool.Poolable