Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Mouse

Map the mouse input.

Hierarchy

  • Mouse

Index

Accessors

Static cursorX

  • get cursorX(): number
  • The X position of the cursor in the window.

    Returns number

Static cursorY

  • get cursorY(): number
  • The Y position of the cursor in the window.

    Returns number

Static leftButtonDown

  • get leftButtonDown(): boolean
  • Whether the left button is down or not.

    Returns boolean

Static leftButtonUp

  • get leftButtonUp(): boolean
  • Whether the left button is up or not.

    Returns boolean

Static leftClick

  • get leftClick(): boolean
  • Evaluate to true when a left click occurs.

    Returns boolean

Static middleButtonDown

  • get middleButtonDown(): boolean
  • Whether the middle (wheel) button is down or not.

    Returns boolean

Static middleButtonUp

  • get middleButtonUp(): boolean
  • Whether the middle button (wheel) is up or not.

    Returns boolean

Static middleClick

  • get middleClick(): boolean
  • Evaluate to true when a middle (wheel) click occurs.

    Returns boolean

Static movementX

  • get movementX(): number
  • The cursor movement in the X axis, in pixels.

    Returns number

Static movementY

  • get movementY(): number
  • The cursor movement in the Y axis, in pixels.

    Returns number

Static rightButtonDown

  • get rightButtonDown(): boolean
  • Whether the right button is down or not.

    Returns boolean

Static rightButtonUp

  • get rightButtonUp(): boolean
  • Whether the right button is up or not.

    Returns boolean

Static rightClick

  • get rightClick(): boolean
  • Evaluate to true when a right click occurs.

    Returns boolean

Static scrollDown

  • get scrollDown(): boolean
  • Evaluate to true when the user is scrolling down.

    Returns boolean

Static scrollLeft

  • get scrollLeft(): boolean
  • Evaluate to true when the user is scrolling left.

    Returns boolean

Static scrollRight

  • get scrollRight(): boolean
  • Evaluate to true when the user is scrolling right.

    Returns boolean

Static scrollUp

  • get scrollUp(): boolean
  • Evaluate to true when the user is scrolling up.

    Returns boolean

Static scrollX

  • get scrollX(): number
  • The scroll movement in the X axis.
    Possible values: -1 (scroll to -x), 0 (no scroll x), 1 (scroll to +x).

    Returns number

Static scrollY

  • get scrollY(): number
  • The scroll movement in the Y axis.
    Possible values: -1 (scroll to -y), 0 (no scroll y), 1 (scroll to +y).

    Returns number

Methods

Static _init

  • _init(canvas: HTMLCanvasElement): void
  • Used internally to initialise the mouse input.

    Parameters

    • canvas: HTMLCanvasElement

      The game's canvas.

    Returns void

Static _update

  • _update(): void
  • Used internally to update the mouse input states.

    Returns void

Generated using TypeDoc