ActionEvent

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

Hierarchy

  • ActionEvent

Index

Constructors

constructor

  • new ActionEvent(source: any, pointerX: number, pointerY: number, meshUnderPointer: Nullable<AbstractMesh>, sourceEvent?: any, additionalData?: any): ActionEvent
  • 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)

    • Optional sourceEvent: any

      the original (browser) event that triggered the ActionEvent

    • Optional additionalData: any

      additional data for the event

    Returns ActionEvent

Properties

additionalData

additionalData: any

additional data for the event

meshUnderPointer

meshUnderPointer: Nullable<AbstractMesh>

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

pointerX

pointerX: number

The X mouse cursor position at the time of the event

pointerY

pointerY: number

The Y mouse cursor position at the time of the event

source

source: any

The mesh or sprite that triggered the action

sourceEvent

sourceEvent: any

the original (browser) event that triggered the ActionEvent

Methods

Static CreateNew

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

    Parameters

    • source: AbstractMesh

      The source mesh that triggered the event

    • Optional evt: Event

      The original (browser) event

    • Optional additionalData: any

      additional data for the event

    Returns ActionEvent

    the new ActionEvent

Static CreateNewFromPrimitive

  • CreateNewFromPrimitive(prim: any, pointerPos: Vector2, evt?: Event, additionalData?: any): ActionEvent
  • Helper function to auto-create an ActionEvent from a primitive

    Parameters

    • prim: any

      defines the target primitive

    • pointerPos: Vector2

      defines the pointer position

    • Optional evt: Event

      The original (browser) event

    • Optional additionalData: any

      additional data for the event

    Returns ActionEvent

    the new ActionEvent

Static CreateNewFromScene

  • Helper function to auto-create an ActionEvent from a scene. If triggered by a mesh use ActionEvent.CreateNew

    Parameters

    • scene: Scene

      the scene where the event occurred

    • evt: Event

      The original (browser) event

    Returns ActionEvent

    the new ActionEvent

Static CreateNewFromSprite

  • 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

    • Optional evt: Event

      The original (browser) event

    • Optional additionalData: any

      additional data for the event

    Returns ActionEvent

    the new ActionEvent

Generated using TypeDoc