Skip to content

Window

Window

The main application window that handles rendering backends, events, and resizing.

Specific kwargs

Argument Type Description
size list | tuple | NvVector2 initial size of the window.
title str window title(default is 'nevu window').
minsize NvVector2 | None minimum window size(default is None).
resizable bool can the window be resized(default is True).
ratio NvVector2 | None aspect ratio to maintain(default is None).
resize_type ResizeType how the window handles resizing(default is CropToRatio).
backend Backend rendering backend to use(default is Pygame).
base_fps int target frames per second(default is 60).

Methods

Name Kwargs Description
clear color: tuple = (0, 0, 0, 0) clears the window with a specific color.
add_request z_request: ZRequest adds a Z-index rendering request.
mark_dirty None marks the Z-system as dirty to force resort.
begin_frame None starts a new frame (required for Raylib).
end_frame None ends the current frame (required for Raylib).
update events: list | None = None, fps: int | None = None updates window state, events, and limits FPS.
draw_overlay None draws the global overlay texture onto the window.
add_event event: NevuEvent adds an event listener to the window.
get_nvrect None returns the bounding rectangle (NvRect) of the window.

Getters

Name ReturnType Description
display DisplayBase the underlying display object.
offset NvVector2 rendering offset caused by ratio cropping.
title str current window title.
ratio NvVector2 current aspect ratio.
original_size NvVector2 the initial size of the window.
rel NvVector2 relative scale factor compared to original size.

Setters

Name Kwargs Description
title text: str sets the window title.
ratio ratio: NvVector2 sets the aspect ratio and recalculates rendering area.

Use case

...#Not provided

Created with GGen v1.1.0 for nevu_ui v0.7.5