MODULE v1.8.0

viewport

pykraken.viewport

Viewport management functions

Reference

PYTHON API

layout

function
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 (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

function
set(rect: Rect) -> None

Set the current viewport to the given rectangle.

Args

  • rect (Rect) — The rectangle defining the viewport.

unset

function
unset() -> None

Unset the current viewport, reverting to the full rendering area.

Find your next step

Start typing to search the manual.