Class MouseMapper

The MouseMapper will map the current position of the mouse to corresponding locations on the canvas.

Constructors

Accessors

  • get mouseX(): number
  • The current mouseX position.

    Returns number

  • get mouseXRatio(): number
  • The current ratio value of the mouseX position, where the left edge of the canvas maps to 0, and the right edge of the canvas maps to 1.

    Returns number

  • get mouseY(): number
  • The current mouseY position.

    Returns number

  • get mouseYRatio(): number
  • The current ratio value of the mouseY position, where the top edge of the canvas maps to 0, and the bottom edge of the canvas maps to 1.

    Returns number

Methods

  • Map the provided x-axis mouse position to the corresponding value on the scale of CoordinateMapper.minX to CoordinateMapper.maxX.

    Parameters

    • mouseX: number

    Returns number

  • Parameters

    • mouseX: number

    Returns number

  • Parameters

    • mouseY: number

    Returns number

  • Parameters

    • mouseY: number

    Returns number