Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ActionEvent

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

Hierarchy

  • ActionEvent

Implements

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

Optional additionalDataSearch playground for additionalData

additionalData: any

additional data for the event

meshUnderPointerSearch playground for meshUnderPointer

meshUnderPointer: Nullable<AbstractMesh>

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

pointerXSearch playground for pointerX

pointerX: number

The X mouse cursor position at the time of the event

pointerYSearch playground for pointerY

pointerY: number

The Y mouse cursor position at the time of the event

sourceSearch playground for source

source: any

The mesh or sprite that triggered the action

Optional sourceEventSearch playground for sourceEvent

sourceEvent: any

the original (browser) event that triggered the ActionEvent

Methods

Static CreateNewSearch playground for CreateNew

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

    Parameters

    • source: AbstractMesh

      The source mesh that triggered the event

    • Optional evt: any

      The original (browser) event

    • Optional additionalData: any

      additional data for the event

    Returns ActionEvent

    the new ActionEvent

Static CreateNewFromPrimitiveSearch playground for CreateNewFromPrimitive

  • 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 CreateNewFromSceneSearch playground for 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: any

      The original (browser) event

    Returns ActionEvent

    the new ActionEvent

Static CreateNewFromSpriteSearch playground for 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: any

      The original (browser) event

    • Optional additionalData: any

      additional data for the event

    Returns ActionEvent

    the new ActionEvent

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method