Viewport

Functions for managing render viewports.


Layout

layout(count: int, mode: ViewportMode) list[Rect]

Arrange the viewport into a grid layout.

Parameters

  • count : The number of viewports to arrange. Must be between 2 and 4.
  • mode : The layout mode to use.

Returns

list[Rect] : A list of rectangles representing the arranged viewports.

Set

set(area: Rect) None

Set a specific area as the render viewport.

Parameters

  • area : The rectangle area to set as the viewport.

Unset

unset() None

Unset the current render viewport, reverting to the default full screen.