Views¶
The GameView is the primary gameplay screen in the Pedre framework. Unlike traditional multi-view architectures, Pedre uses only one view with plugin overlays for different UI states (like pause menus).
Location¶
GameView¶
Primary gameplay view with player control, NPCs, and interactions.
Constructor¶
Parameters:
game: Game- Game coordinator instance
Note: The GameView is typically created and managed by the Game coordinator. You rarely need to instantiate it directly.
Key Plugins¶
The GameView provides access to all game plugins through its context:
npc_plugin: NPCPlugin- NPC state and interactionsdialog_plugin: DialogPlugin- Dialog displayinventory_plugin: InventoryPlugin- Item managementscript_plugin: ScriptPlugin- Event-driven scriptsaudio_plugin: AudioPlugin- Sound and musicsave_plugin: SavePlugin- Game persistencecamera_plugin: CameraPlugin- Camera controlportal_plugin: PortalPlugin- Map transitionsinteraction_plugin: InteractionPlugin- Object interactionsparticle_plugin: ParticlePlugin- Visual effects
Example¶
# Access via game coordinator
game_view = game.game_view
# Access plugins through context
context = game.game_context
npc_plugin = context.get_plugin("npc")
dialog_plugin = context.get_plugin("dialog")
Architecture Notes¶
- Single View Design: Pedre uses only the GameView. There are no separate MenuView, LoadGameView, or SaveGameView classes.
- Plugin Overlays: UI states like pause menus are implemented as plugin overlays on top of the GameView, not as separate views.
- Managed Lifecycle: The Game coordinator manages the GameView lifecycle, creating and destroying it as needed for new games or loaded games.
See Also¶
- Game - Game coordinator and lifecycle management
- GameContext - Shared state container
- Plugins Reference - Individual plugin documentation