PointerEventReceiver
Index
Constructors
Properties
Methods
Constructors
constructor
Parameters
target: GlobalEventHandlers & EventTarget
engine: Engine<any>
Returns PointerEventReceiver
Properties
publiccurrentFrameCancel
publiccurrentFrameDown
publiccurrentFrameMove
publiccurrentFramePointerCoords
publiccurrentFramePointerDown
publiccurrentFrameUp
publiccurrentFrameWheel
publicengine
publicevents
publiclastFramePointerCoords
publiclastFramePointerDown
publicprimary
publicreadonlytarget
Methods
publicat
Locates a specific pointer by id, creates it if it doesn't exist
Parameters
index: number
Returns PointerAbstraction
publicclear
Clears the current frame event and pointer data
Returns void
publiccount
The number of pointers currently being tracked by excalibur
Returns number
publicdetach
Returns void
publicemit
Type parameters
- TEventName: EventKey<PointerEvents>
Parameters
eventName: TEventName
event: PointerEvents[TEventName]
Returns void
publicinit
Initializes the pointer event receiver so that it can start listening to native browser events.
Parameters
optionaloptions: PointerInitOptions
Returns void
publicisDown
Is the specified pointer id down this frame
Parameters
pointerId: number
Returns boolean
publicisDragEnd
Whether the Pointer just ended dragging.
Parameters
pointerId: number
Returns boolean
publicisDragStart
Whether the Pointer just started dragging.
Parameters
pointerId: number
Returns boolean
publicisDragging
Whether the Pointer is currently dragging.
Parameters
pointerId: number
Returns boolean
publicoff
publicon
Type parameters
- TEventName: EventKey<PointerEvents>
Parameters
eventName: TEventName
handler: Handler<PointerEvents[TEventName]>
Returns Subscription
publiconce
Type parameters
- TEventName: EventKey<PointerEvents>
Parameters
eventName: TEventName
handler: Handler<PointerEvents[TEventName]>
Returns Subscription
publicrecreate
Creates a new PointerEventReceiver with a new target and engine while preserving existing pointer event handlers.
Parameters
target: GlobalEventHandlers & EventTarget
engine: Engine<any>
Returns PointerEventReceiver
publictoggleEnabled
Parameters
enabled: boolean
Returns void
publictriggerEvent
Triggers an excalibur pointer event in a world space pos
Useful for testing pointers in excalibur
Parameters
type: down | up | move | cancel
pos: Vector
Returns void
publicwasDown
Was the specified pointer id down last frame
Parameters
pointerId: number
Returns boolean
The PointerEventProcessor is responsible for collecting all the events from the canvas and transforming them into GlobalCoordinates