Options
All
  • Public
  • Public/Protected
  • All
Menu

The PointerEventProcessor is responsible for collecting all the events from the canvas and transforming them into GlobalCoordinates

Hierarchy

  • Class
    • PointerEventReceiver

Index

Constructors

Properties

currentFrameCancel: PointerEvent[] = []
currentFrameDown: PointerEvent[] = []
currentFrameMove: PointerEvent[] = []
currentFramePointerCoords: Map<number, GlobalCoordinates> = ...
currentFramePointerDown: Map<number, boolean> = ...
currentFrameUp: PointerEvent[] = []
currentFrameWheel: WheelEvent[] = []
engine: Engine
eventDispatcher: EventDispatcher<any>

Direct access to the game object event dispatcher.

lastFramePointerCoords: Map<number, GlobalCoordinates> = ...
lastFramePointerDown: Map<number, boolean> = ...
primary: PointerAbstraction = ...
target: GlobalEventHandlers & EventTarget

Methods

  • at(index: number): PointerAbstraction
  • clear(): void
  • count(): number
  • detach(): void
  • emit(eventName: string, eventObject: any): void
  • Emits a new event

    Parameters

    • eventName: string

      Name of the event to emit

    • eventObject: any

      Data associated with this event

    Returns void

  • init(): void
  • isDown(pointerId: number): boolean
  • isDragEnd(pointerId: number): boolean
  • isDragStart(pointerId: number): boolean
  • isDragging(pointerId: number): boolean
  • off(event: "move", handler?: (event: PointerEvent) => void): void
  • off(event: "down", handler?: (event: PointerEvent) => void): void
  • off(event: "up", handler?: (event: PointerEvent) => void): void
  • off(event: "wheel", handler?: (event: WheelEvent) => void): void
  • on(event: "move", handler: (event: PointerEvent) => void): void
  • on(event: "down", handler: (event: PointerEvent) => void): void
  • on(event: "up", handler: (event: PointerEvent) => void): void
  • on(event: "wheel", handler: (event: WheelEvent) => void): void
  • once(event: "move", handler: (event: PointerEvent) => void): void
  • once(event: "down", handler: (event: PointerEvent) => void): void
  • once(event: "up", handler: (event: PointerEvent) => void): void
  • once(event: "wheel", handler: (event: WheelEvent) => void): void
  • triggerEvent(type: "cancel" | "move" | "up" | "down", pos: Vector): void
  • Triggers an excalibur pointer event in a world space pos

    Useful for testing pointers in excalibur

    Parameters

    • type: "cancel" | "move" | "up" | "down"
    • pos: Vector

    Returns void

  • update(): void
  • Called internally by excalibur

    Updates the current frame pointer info and emits raw pointer events

    This does not emit events to entities, see PointerSystem

    Returns void

  • wasDown(pointerId: number): boolean