Class CoordinateMapper

Constructors

Accessors

  • get centerX(): number
  • The center x-axis value of the canvas.

    Returns number

  • get centerY(): number
  • The center y-axis value of the canvas.

    Returns number

  • get maxX(): number
  • The maximum visible x-axis value of the canvas.

    Returns number

  • get maxY(): number
  • The maximum visible y-axis value of the canvas.

    Returns number

  • get minX(): number
  • The minimum visible x-axis value of the canvas.

    Returns number

  • get minY(): number
  • The minimum visible y-axis value of the canvas.

    Returns number

Methods

  • Parameters

    • canvasVector: Vector

    Returns Vector

  • Parameters

    • canvasX: number

    Returns number

  • Parameters

    • canvasY: number

    Returns number

  • Parameters

    • ratioVector: Vector

    Returns Vector

  • Map a percentage value to a value on the x-axis of the canvas. A percentage value of 0.5 will be exactly in the middle of the x-axis, regardless of canvas resolution or aspect ratio.

    Parameters

    • ratio: number

      The percentage expressed as a decimal number (e.g. 50% = 0.5)

    Returns number

  • Map a percentage value to a value on the y-axis of the canvas. A percentage value of 0.5 will be exactly in the middle of the y-axis, regardless of canvas resolution or aspect ratio.

    Parameters

    • ratio: number

      The percentage expressed as a decimal number (e.g. 50% = 0.5)

    Returns number