Kraken Logo

Kraken Engine

DocumentationGuidesShowcaseCommunity
Ctrl
K
Navigating the Docs
Building Docs
Overview
Camera
Color
Draw
Ease
Event
Fx
Gamepad
Input
Log
Math
Mixer
Mouse
Physics
Pixel Array
Renderer
Shaders
Time
Transform
Ui
Viewport
Window

Built bydurkisneer1.Kraken Engine is open source and available onGitHub.

  1. Docs
  2. Functions
  3. Viewport

Viewport

Viewport management functions


Layout

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

set(rect: Rect) → Noneset(rect: Rect) → None

Set the current viewport to the given rectangle.

Args

  • rect : The rectangle defining the viewport.

Unset

unset() → Noneunset() → None

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

PreviousUi
NextWindow

On this page

LayoutSetUnset