Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Pointer

Hierarchy

  • EventDispatcher
    • Pointer

Index

Constructors

  • Returns Pointer

Properties

delta: Vector2
isSP: boolean
isTouching: boolean
position: Vector2
trackpadMax: boolean = false
trackpadMemDelta: number = 0

Methods

  • addEventListener<T>(type: T, listener: EventListener<Event, T, Pointer>): void
  • Adds a listener to an event type.

    Type parameters

    • T: string

    Parameters

    • type: T

      The type of event to listen to.

    • listener: EventListener<Event, T, Pointer>

      The function that gets called when the event is fired.

    Returns void

  • dispatchEvent(event: Event): void
  • Fire an event type.

    Parameters

    • event: Event

    Returns void

  • getRelativePosition(elm: HTMLElement, screen?: boolean): Vector2
  • Parameters

    • elm: HTMLElement
    • Optional screen: boolean

    Returns Vector2

  • getScreenPosition(windowSize: Vector2): Vector2
  • Parameters

    • windowSize: Vector2

    Returns Vector2

  • hasEventListener<T>(type: T, listener: EventListener<Event, T, Pointer>): boolean
  • Checks if listener is added to an event type.

    Type parameters

    • T: string

    Parameters

    • type: T

      The type of event to listen to.

    • listener: EventListener<Event, T, Pointer>

      The function that gets called when the event is fired.

    Returns boolean

  • onPointer(type: string, e: PointerEvent | DragEvent): void
  • Parameters

    • type: string
    • e: PointerEvent | DragEvent

    Returns void

  • onTouch(type: string, e: TouchEvent): void
  • Parameters

    • type: string
    • e: TouchEvent

    Returns void

  • registerElement(elm: HTMLElement): void
  • Parameters

    • elm: HTMLElement

    Returns void

  • removeEventListener<T>(type: T, listener: EventListener<Event, T, Pointer>): void
  • Removes a listener from an event type.

    Type parameters

    • T: string

    Parameters

    • type: T

      The type of the listener that gets removed.

    • listener: EventListener<Event, T, Pointer>

      The listener function that gets removed.

    Returns void

  • setPos(x: number, y: number): void
  • Parameters

    • x: number
    • y: number

    Returns void

  • touchEventHandler(posX: number, posY: number, type: string, e: PointerEvent | TouchEvent | DragEvent): void
  • Parameters

    • posX: number
    • posY: number
    • type: string
    • e: PointerEvent | TouchEvent | DragEvent

    Returns void

  • unregisterElement(elm: HTMLElement): void
  • Parameters

    • elm: HTMLElement

    Returns void

  • update(): void
  • Returns void

  • wheel(e: WheelEvent): void
  • Parameters

    • e: WheelEvent

    Returns void

Generated using TypeDoc