Class ActionEvent
Hierarchy
- ActionEvent
Implements
Index
Constructors
constructor
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 additional DataSearch playground for additionalData
additional data for the event
mesh Under PointerSearch playground for meshUnderPointer
The mesh that is currently pointed at (can be null)
pointerXSearch playground for pointerX
The X mouse cursor position at the time of the event
pointerYSearch playground for pointerY
The Y mouse cursor position at the time of the event
sourceSearch playground for source
The mesh or sprite that triggered the action
Optional source EventSearch playground for sourceEvent
the original (browser) event that triggered the ActionEvent
Methods
Static Create NewSearch 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 Create New From PrimitiveSearch 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 Create New From SceneSearch 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 Create New From SpriteSearch 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
ActionEvent is the event being sent when an action is triggered.