ActionEvent

Action

Description

class ActionEvent

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

Constructor

new ActionEvent(source, pointerX, pointerY, meshUnderPointer, sourceEvent, additionalData)

Parameters

Name Type Description
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

Members

source : any

pointerX : number

pointerY : number

meshUnderPointer : Nullable<AbstractMesh>

sourceEvent : any

additionalData : any

Methods

static CreateNew(source, evt, additionalData) ActionEvent

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

Parameters

Name Type Description
source AbstractMesh The source mesh that triggered the event
optional evt Event {Event} The original (browser) event
optional additionalData any

static CreateNewFromSprite(source, scene, evt, additionalData) ActionEvent

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

Parameters

Name Type Description
source Sprite The source sprite that triggered the event
scene Scene Scene associated with the sprite
optional evt Event {Event} The original (browser) event

static CreateNewFromScene(scene, evt) ActionEvent

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

Parameters

Name Type Description
scene Scene the scene where the event occurred
evt Event {Event} The original (browser) event

static CreateNewFromPrimitive(prim, pointerPos, evt, additionalData) ActionEvent

Parameters

Name Type Description
prim any
pointerPos Vector2
optional evt Event