mini_arcade_core.backend

Backend module for rendering and input abstraction. Defines the Backend interface and related types. This is the only part of the code that talks to SDL/pygame directly.

Submodules

Classes

Backend

Interface that any rendering/input backend must implement.

Package Contents

class mini_arcade_core.backend.Backend[source]

Bases: Protocol

Interface that any rendering/input backend must implement. mini-arcade-core only talks to this protocol, never to SDL/pygame directly.

Variables:
  • (WindowProtocol) (window) – Window management interface.

  • (AudioProtocol) (audio) – Audio management interface.

  • (InputProtocol) (input) – Input management interface.

  • (RenderProtocol) (render) – Rendering interface.

  • (TextProtocol) (text) – Text rendering interface.

  • (CaptureProtocol) (capture) – Frame capture interface.

window: WindowProtocol
audio: AudioProtocol
input: InputProtocol
render: RenderProtocol
text: TextProtocol
capture: CaptureProtocol
init()[source]

Initialize the backend and open a window. Should be called once before the main loop.

set_viewport_transform(offset_x: int, offset_y: int, scale: float)[source]

Set the viewport transformation.

Parameters:
  • offset_x (int) – Horizontal offset.

  • offset_y (int) – Vertical offset.

  • scale (float) – Scaling factor.

clear_viewport_transform()[source]

Clear the viewport transformation (reset to defaults).