mini_arcade_core.runtime.window.window_port¶
Service interfaces for runtime components.
Classes¶
Interface for window-related operations. |
Module Contents¶
- class mini_arcade_core.runtime.window.window_port.WindowPort¶
Bases:
ProtocolInterface for window-related operations.
- set_viewport_mode(mode: mini_arcade_core.engine.render.viewport.ViewportMode)¶
Set the viewport mode for rendering.
- Parameters:
mode (ViewportMode) – The viewport mode to set.
- get_viewport() mini_arcade_core.engine.render.viewport.ViewportState¶
Get the current viewport state.
- Returns:
The current ViewportState.
- Return type:
- screen_to_virtual(x: float, y: float) tuple[float, float]¶
Convert screen coordinates to virtual coordinates.
- Parameters:
x (float) – X coordinate on the screen.
y (float) – Y coordinate on the screen.
- Returns:
Corresponding virtual coordinates (x, y).
- Return type:
tuple[float, float]
- set_virtual_resolution(width: int, height: int)¶
Set the virtual resolution for rendering.
- Parameters:
width (int) – Virtual width in pixels.
height (int) – Virtual height in pixels.
- set_title(title: str)¶
Set the window title.
- Parameters:
title (str) – The new title for the window.
- set_clear_color(r: int, g: int, b: int)¶
Set the clear color for the window.
- Parameters:
r (int) – Red component (0-255).
g (int) – Green component (0-255).
b (int) – Blue component (0-255).
- on_window_resized(width: int, height: int)¶
Handle window resized event.
- Parameters:
width (int) – New width of the window.
height (int) – New height of the window.
- get_virtual_size() tuple[int, int]¶
Get the current virtual resolution size.
- Returns:
Tuple of (virtual_width, virtual_height).
- Return type:
tuple[int, int]