Expand description
Menu system abstractions for JRPG engine.
This module defines:
MenuProvidertrait — game-data provider for menu definitions (titles, options, layouts). Implemented by the data crate.MenuSystem<M>struct — stateful menu controller that manages cursor position, scroll offset, input handling, and rendering.MenuInput/MenuAction— input abstraction and action results.NamedMenuInputSourcetrait — platform-level input conversion.
§Design
The menu system is data-driven: the provider supplies static layout
and option data, while MenuSystem owns the runtime state (cursor,
scroll, open/closed). Rendering uses the Painter
trait, so menus work identically across pixel and recording backends.
Structs§
- Border
Style - A configurable 9-slot border for menus. Each slot references a tile index in the currently active tileset. Editors can swap these to change the visual style without code changes.
- Cursor
Style - Cursor indicator style for menus.
- Edge
Insets - Padding inside a menu container (in tiles).
- Menu
Config - Rendering-level layout for a menu. Describes where and how a menu is drawn on the 160×144 canvas.
- Menu
Input - Abstract menu input, decoupled from any specific platform or key binding.
- Menu
Layout - Static layout descriptor for a menu.
- Menu
Option - A single option in a menu list.
- Menu
System - Stateful menu controller that owns cursor position, scroll offset, and open/closed state.
Enums§
- Cursor
Anchor - Cursor anchor point relative to a menu entry.
- Menu
Action - Outcome of
MenuSystem::handle_input. - Tile
Slot - Position slot in a border tile set. Used by editors to identify which border tile to swap.
Traits§
- Menu
Provider - Provider of static menu definitions (titles, options, layouts).
- Named
Menu Input Source - Trait for converting platform-specific input (keyboard, gamepad,
touch) into abstract
MenuInput.