Viewport
Viewport
¶
Viewport(
canvas: Canvas,
x: Transform | float | int,
y: Transform | float | int,
width: Transform | float | int,
height: Transform | float | int,
color: Color,
)
A viewport is a rectangular two-dimensional surface from a canvas, located at (x, y) coordinates (bottom left corner) with size equal to width×height pixels and a background color.
Notes
Future implementation will allows viewports to have an arbitrary rotation.
Example
A viewport is a rectangular two-dimensional surface.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
canvas
|
Canvas
|
Canvas where to create the viewport |
required |
x
|
Transform | float | int
|
X coordinate of the viewport bottom left corner |
required |
y
|
Transform | float | int
|
Y coordinate of the viewport bottom left corner |
required |
width
|
Transform | float | int
|
Width of the viewport in pixels. |
required |
height
|
Transform | float | int
|
Height of the viewport in pixels. |
required |
color
|
Color
|
Background color of the viewport |
required |