Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Viewport

Hierarchy

  • Rectangle
    • Viewport

Index

Constructors

constructor

  • new Viewport(left: number, bottom: number, width: number, height: number): Viewport
  • Parameters

    • left: number
    • bottom: number
    • width: number
    • height: number

    Returns Viewport

Properties

Bottom

Bottom: number

Height

Height: number

Left

Left: number

Right

Right: number

Top

Top: number

Width

Width: number

Methods

configure

  • configure(gl: WebGLRenderingContext, withoutOffset?: boolean): void
  • Parameters

    • gl: WebGLRenderingContext
    • Default value withoutOffset: boolean = false

    Returns void

contains

  • contains(point: Vector2): boolean
  • contains(x: number, y: number): boolean
  • Parameters

    • point: Vector2

    Returns boolean

  • Parameters

    • x: number
    • y: number

    Returns boolean

toAbsolute

  • toAbsolute(x: Vector2): Vector2
  • toAbsolute(x: number, y: number): number[]
  • Convert local coordinate to absolute coordinate

    Parameters

    • x: Vector2

    Returns Vector2

    [description]

  • Parameters

    • x: number
    • y: number

    Returns number[]

toLocal

  • toLocal(x: Vector2): Vector2
  • toLocal(x: number, y: number): number[]
  • Convert absolute coodinate to local coordinate

    Parameters

    • x: Vector2

    Returns Vector2

    [description]

  • Parameters

    • x: number
    • y: number

    Returns number[]

toLocalNormalized

  • toLocalNormalized(x: Vector2): Vector2
  • toLocalNormalized(x: number, y: number): number[]
  • Convert relative ratio of position in the rectangle from absolute coordinate

    Parameters

    • x: Vector2

    Returns Vector2

    [description]

  • Parameters

    • x: number
    • y: number

    Returns number[]

toString

  • toString(): string
  • Returns string

Static edgeSizeEquals

  • edgeSizeEquals(r1: Rectangle, r2: Rectangle): boolean
  • Parameters

    • r1: Rectangle
    • r2: Rectangle

    Returns boolean

Static equals

  • equals(r1: Rectangle, r2: Rectangle): boolean
  • Parameters

    • r1: Rectangle
    • r2: Rectangle

    Returns boolean

Generated using TypeDoc