Constructor
new Viewport(spec)
Instantiates a Viewport object.
- Source:
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
spec |
Object
|
The viewport specification object.
|
Methods
push(x, y, width, height) → {Viewport}
Sets the viewport dimensions and position. The underlying canvas element
is not affected.
- Source:
Parameters:
Name | Type | Default | Description |
---|---|---|---|
x |
number
|
0 | The horizontal offset override. |
y |
number
|
0 | The vertical offset override. |
width |
number
|
The width override. | |
height |
number
|
The height override. |
resize(width, height) → {Viewport}
Updates the viewports width and height. This resizes the underlying canvas element.
- Source:
Parameters:
Name | Type | Default | Description |
---|---|---|---|
width |
number
|
0 | The width of the viewport. |
height |
number
|
0 | The height of the viewport. |