viewport
pykraken.viewport Viewport management functions
At a glance
3 membersReference
PYTHON APIlayout
functionlayout(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 (
int) — The number of viewports to create (between 2 and 4). - mode (
ViewportMode, optional) — The layout mode for 2 viewports (VERTICAL or HORIZONTAL). Defaults to VERTICAL.
Returns
list[Rect]: A list of Rects representing the viewports.
set
functionset(rect: Rect) -> NoneSet the current viewport to the given rectangle.
Args
- rect (
Rect) — The rectangle defining the viewport.
unset
functionunset() -> NoneUnset the current viewport, reverting to the full rendering area.