Window
Functions for creating and managing an application window.
Create
create(title: str, resolution: Vec2, scaled: bool = False) → NoneCreate a new application window.
Parameters
title: The title of the window.resolution: The initial resolution of the window.scaled: Whether the window should be automatically scaled up to fit into the display.
Is Open
is_open() → boolCheck if the window is currently open.
Returns
bool : True if the window is open, False otherwise.
Close
close() → NoneClose the application window.
Get Size
get_size() → Vec2Get the current size of the window. If scaled, the size will be adjusted to fit the display.
Returns
Vec2 : The current size of the window.
Set Fullscreen
set_fullscreen(fullscreen: bool) → NoneSet the window to a fullscreen mode.
Parameters
fullscreen: Whether to enable or disable fullscreen mode.
Is Fullscreen
is_fullscreen() → boolCheck if the window is currently in fullscreen mode.
Returns
bool : True if the window is in fullscreen mode, False otherwise.
Set Title
set_title(title: str) → NoneSet the title of the window.
Parameters
title: The new title of the window.
Get Title
get_title() → strGet the current title of the window.
Returns
str : The current title of the window.
Get Scale
get_scale() → intGet the scale of the window relative to the renderer resolution.
Returns
int : The current scale factor of the window.
Save Screenshot
save_screenshot(path: str) → NoneSave a screenshot of the current window content to a file.
Parameters
path: The file path where the screenshot will be saved.
Set Icon
set_icon(path: str) → NoneSet the icon of the application window.
Parameters
path: The file path to the icon image.