Viewport management functions
layout(count: int, mode: ViewportMode = ViewportMode.VERTICAL) → list[Rect]layout(count: int, 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(rect: Rect) → Noneset(rect: Rect) → NoneSet the current viewport to the given rectangle.
Args
rect : The rectangle defining the viewport.unset() → Noneunset() → NoneUnset the current viewport, reverting to the full rendering area.