Viewport
Viewport management functions
Layout
layout(
count: SupportsInt,
mode: ViewportMode = ViewportMode.VERTICAL
) → list[Rect]Layout the screen into multiple viewports. The viewports are created with the current renderer target resolution in mind.
Args
count: The number of viewports to create (between 2 and 4).mode: The layout mode for 2 viewports (VERTICAL or HORIZONTAL). Defaults to VERTICAL.
Returns
list[Rect] : A list of Rects representing the viewports.
Set
set(rect: Rect) → NoneSet the current viewport to the given rectangle.
Args
rect: The rectangle defining the viewport.
Unset
unset() → NoneUnset the current viewport, reverting to the full rendering area.