ActionEvent

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

Hierarchy

  • ActionEvent

Index

Constructors

constructor

Find examples in Playground
  • 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

Optional additionalData

Find examples in Playground
additionalData: any

additional data for the event

meshUnderPointer

Find examples in Playground
meshUnderPointer: Nullable<AbstractMesh>

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

pointerX

Find examples in Playground
pointerX: number

The X mouse cursor position at the time of the event

pointerY

Find examples in Playground
pointerY: number

The Y mouse cursor position at the time of the event

source

Find examples in Playground
source: any

The mesh or sprite that triggered the action

Optional sourceEvent

Find examples in Playground
sourceEvent: any

the original (browser) event that triggered the ActionEvent

Methods

Static CreateNew

Find examples in Playground
  • 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

Find examples in Playground
  • 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

Find examples in Playground
  • 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

Find examples in Playground
  • 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