escapy.pygame
pygame submodule for escapy.
This submodule contains the PyGameUi implementation.
- class escapy.pygame.PyGameUi(config, message_provider)[source]
Bases:
GameUiProtocolPygame-based game UI.
Manages the display window, input handling, and rendering. Three distinct internal states control how input is interpreted:
Normal – clicks on room objects or inventory items.
InsertCode – keyboard input for a code prompt.
Inspect – fullscreen view of an object image.
- Parameters:
config (dict) – UI configuration dictionary (window size, asset paths, layout fractions, etc.).
message_provider (MessageProvider) – Callable that maps events to display strings.
- init(game)[source]
Bind the UI to a
GameProtocoland start running.- Parameters:
game (GameProtocol)
Submodules
escapy.pygame.pygame_ui
Pygame-based UI implementation for escapy.
Provides PyGameUi, a concrete implementation of
GameUiProtocol that renders the game using
pygame. The UI is split into three screen regions: the main game
area, an inventory sidebar, and a message bar.
- class escapy.pygame.pygame_ui.PyGameUi(config, message_provider)[source]
Bases:
GameUiProtocolPygame-based game UI.
Manages the display window, input handling, and rendering. Three distinct internal states control how input is interpreted:
Normal – clicks on room objects or inventory items.
InsertCode – keyboard input for a code prompt.
Inspect – fullscreen view of an object image.
- Parameters:
config (dict) – UI configuration dictionary (window size, asset paths, layout fractions, etc.).
message_provider (MessageProvider) – Callable that maps events to display strings.
- init(game)[source]
Bind the UI to a
GameProtocoland start running.- Parameters:
game (GameProtocol)