CLASSES
TagsA - Z

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)

@constructor

Parameters

Name Type Description
source any The mesh or sprite that triggered the action. The source sprite that triggered the event The source sprite that triggered the event The source sprite that triggered the event the source mesh that triggered the event the source mesh that triggered the event
pointerX number The X mouse cursor position at the time of the event The X mouse cursor position at the time of the event The X mouse cursor position at the time of the event The X mouse cursor position at the time of the event the X mouse cursor position at the time of the event the X mouse cursor position at the time of the event
pointerY number The Y mouse cursor position at the time of the event The Y mouse cursor position at the time of the event The Y mouse cursor position at the time of the event The Y mouse cursor position at the time of the event the Y mouse cursor position at the time of the event the Y mouse cursor position at the time of the event
meshUnderPointer AbstractMesh The mesh that is currently pointed at (can be null) The mesh that is currently pointed at (can be null) The mesh that is currently pointed at (can be null) The mesh that is currently pointed at (can be null) The mesh that is currently pointed at (can be null) The mesh that is currently pointed at (can be null)
optional sourceEvent any the original (browser) event that triggered the ActionEvent the original (browser) event that triggered the ActionEvent the original (browser) event that triggered the ActionEvent the original (browser) event that triggered the ActionEvent the original (browser) event that triggered the ActionEvent the original (browser) event that triggered the ActionEvent

Members

source : any

The source of the action event

pointerX : number

The pointer X position

pointerY : number

The pointer Y position

meshUnderPointer : AbstractMesh

The mesh under the pointer position

sourceEvent : any

The source of the event

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 The source sprite that triggered the event The source sprite that triggered the event The source sprite that triggered the event the source mesh that triggered the event the source mesh that triggered the event
optional evt Event {Event} The original (browser) event {Event} The original (browser) event {Event} The original (browser) 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 The source sprite that triggered the event The source sprite that triggered the event The source sprite that triggered the event the source mesh that triggered the event the source mesh that triggered the event
scene Scene Scene associated with the sprite the scene where the event occurred the scene where the event occurred the scene where the event occurred the scene where the event occurred the scene where the event occurred
optional evt Event {Event} The original (browser) event {Event} The original (browser) event {Event} The original (browser) 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 the scene where the event occurred the scene where the event occurred the scene where the event occurred the scene where the event occurred the scene where the event occurred
evt Event {Event} The original (browser) event {Event} The original (browser) event {Event} The original (browser) event {Event} The original (browser) event

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

Parameters

Name Type Description
prim any
pointerPos Vector2
optional evt Event {Event} The original (browser) event {Event} The original (browser) event {Event} The original (browser) event