Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Viewport

Class used to represent a viewport on screen

Hierarchy

  • Viewport

Index

Constructors

Properties

Methods

Constructors

constructor

  • 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

heightSearch playground for height

height: number

viewport height

widthSearch playground for width

width: number

viewport width

xSearch playground for x

x: number

viewport left coordinate

ySearch playground for y

y: number

viewport top coordinate

Methods

cloneSearch playground for clone

  • Returns a new Viewport copied from the current one

    Returns Viewport

    a new Viewport

toGlobalSearch playground for toGlobal

  • toGlobal(renderWidth: number, renderHeight: number): Viewport
  • Creates a new viewport using absolute sizing (from 0-> width, 0-> height instead of 0->1)

    Parameters

    • renderWidth: number

      defines the rendering width

    • renderHeight: number

      defines the rendering height

    Returns Viewport

    a new Viewport

toGlobalToRefSearch playground for toGlobalToRef

  • toGlobalToRef(renderWidth: number, renderHeight: number, ref: Viewport): Viewport
  • Stores absolute viewport value into a target viewport (from 0-> width, 0-> height instead of 0->1)

    Parameters

    • renderWidth: number

      defines the rendering width

    • renderHeight: number

      defines the rendering height

    • ref: Viewport

      defines the target viewport

    Returns Viewport

    the current viewport

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method