API

Class ActionEvent

ActionEvent is the event being sent when an action is triggered.

Implements

Index
  • Creates a new ActionEvent

    Parameters

    • source: any

      The mesh or sprite that triggered the action

    • pointerX: number

      The X mouse cursor position at the time of the event

    • pointerY: number

      The Y mouse cursor position at the time of the event

    • meshUnderPointer: Nullable<AbstractMesh>

      The mesh that is currently pointed at (can be null)

    • OptionalsourceEvent: any

      the original (browser) event that triggered the ActionEvent

    • OptionaladditionalData: any

      additional data for the event

    Returns ActionEvent

additionalData?: any

additional data for the event

meshUnderPointer: Nullable<AbstractMesh>

The mesh that is currently pointed at (can be null)

pointerX: number

The X mouse cursor position at the time of the event

pointerY: number

The Y mouse cursor position at the time of the event

source: any

The mesh or sprite that triggered the action

sourceEvent?: any

the original (browser) event that triggered the ActionEvent

  • Helper function to auto-create an ActionEvent from a primitive

    Parameters

    • prim: any

      defines the target primitive

    • pointerPos: Vector2

      defines the pointer position

    • Optionalevt: Event

      The original (browser) event

    • OptionaladditionalData: any

      additional data for the event

    Returns ActionEvent

    the new ActionEvent

  • Helper function to auto-create an ActionEvent from a source sprite

    Parameters

    • source: Sprite

      The source sprite that triggered the event

    • scene: Scene

      Scene associated with the sprite

    • Optionalevt: any

      The original (browser) event

    • OptionaladditionalData: any

      additional data for the event

    Returns ActionEvent

    the new ActionEvent