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
  • 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

    Returns ActionEvent

Properties

additionalData

additionalData: any

meshUnderPointer

meshUnderPointer: Nullable<AbstractMesh>

pointerX

pointerX: number

pointerY

pointerY: number

source

source: any

sourceEvent

sourceEvent: any

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

    Returns ActionEvent

Static CreateNewFromPrimitive

  • CreateNewFromPrimitive(prim: any, pointerPos: Vector2, evt?: Event, additionalData?: any): ActionEvent
  • Parameters

    • prim: any
    • pointerPos: Vector2
    • Optional evt: Event
    • Optional additionalData: any

    Returns 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

Static CreateNewFromSprite

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

    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

    Returns ActionEvent

Generated using TypeDoc