CLASSES
TagsA - Z

Viewport

Description

class Viewport

Constructor

new Viewport(x, y, width, height)

Creates a Viewport object located at (x, y) and sized (width, height).

Parameters

Name Type Description
x number The initial x coordinate of the upper-left pixel of the viewport
y number The initial y coordinate of the upper-left pixel of the viewport
width number The initial width of the viewport

Members

x : number

The pixel x coordinate of the upper-left corner of the viewport on the render-target surface

y : number

The pixel y coordinate of the upper-left corner of the viewport on the render-target surface

width : number

The width of the viewport on the render-target surface in pixels

height : number

The height of the viewport on the render-target surface in pixels

Methods

toGlobal(renderWidth, renderHeight) → Viewport

Parameters

Name Type Description
renderWidth number
renderHeight number

clone() → Viewport

Returns a new Viewport copied from the current one.