Viewport

Class used to represent a viewport on screen

Hierarchy

  • Viewport

Index

Constructors

Properties

Methods

Constructors

constructor

Find examples in Playground
  • new Viewport(x: number, y: number, width: number, height: number): Viewport
  • Creates a Viewport object located at (x, y) and sized (width, height)

    Parameters

    • x: number

      defines viewport left coordinate

    • y: number

      defines viewport top coordinate

    • width: number

      defines the viewport width

    • height: number

      defines the viewport height

    Returns Viewport

Properties

height

Find examples in Playground
height: number

viewport height

width

Find examples in Playground
width: number

viewport width

x

Find examples in Playground
x: number

viewport left coordinate

y

Find examples in Playground
y: number

viewport top coordinate

Methods

clone

Find examples in Playground
  • Returns a new Viewport copied from the current one

    Returns Viewport

    a new Viewport

toGlobal

Find examples in Playground
  • toGlobal(renderWidthOrEngine: number | Engine, renderHeight: number): Viewport
  • Creates a new viewport using absolute sizing (from 0-> width, 0-> height instead of 0->1)

    Parameters

    • renderWidthOrEngine: number | Engine

      defines either an engine or the rendering width

    • renderHeight: number

      defines the rendering height

    Returns Viewport

    a new Viewport

Generated using TypeDoc