Skip to main content

Module menu

Module menu 

Source
Expand description

Menu system abstractions for JRPG engine.

This module defines:

  • MenuProvider trait — 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.
  • NamedMenuInputSource trait — 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§

BorderStyle
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.
CursorStyle
Cursor indicator style for menus.
EdgeInsets
Padding inside a menu container (in tiles).
MenuConfig
Rendering-level layout for a menu. Describes where and how a menu is drawn on the 160×144 canvas.
MenuInput
Abstract menu input, decoupled from any specific platform or key binding.
MenuLayout
Static layout descriptor for a menu.
MenuOption
A single option in a menu list.
MenuSystem
Stateful menu controller that owns cursor position, scroll offset, and open/closed state.

Enums§

CursorAnchor
Cursor anchor point relative to a menu entry.
MenuAction
Outcome of MenuSystem::handle_input.
TileSlot
Position slot in a border tile set. Used by editors to identify which border tile to swap.

Traits§

MenuProvider
Provider of static menu definitions (titles, options, layouts).
NamedMenuInputSource
Trait for converting platform-specific input (keyboard, gamepad, touch) into abstract MenuInput.