Expand description
§text
Trait-based text engine for JRPG dialog systems.
This module defines the TextProvider trait — the abstraction that
game-specific implementations must fulfill to provide character mapping,
rendering, and control-code handling. It also provides TileBuffer
(the rendering surface), DialogState, TextStream, ControlAction,
and DialogEngine — a general-purpose dialog engine that drives text
display one character per frame.
§Design
- Provider pattern: All game-specific text encoding lives in the
TextProviderimplementation. The engine owns no charmap data. - No game-specific semantics: Control codes like trainer name, monster name, and item substitutions come from the game-specific provider.
- Frame-by-frame typing:
DialogEngine::updateprocesses one character per call, enabling the classic typewriter effect.
Structs§
- Dialog
Engine - A general-purpose dialog engine that drives text display one character per frame.
- Dialog
State - Full state of the dialog engine.
- Text
Stream - A decoded character stream with a cursor for sequential reading.
- Tile
Buffer - A configurable-width tile grid representing the text rendering surface.
- Tile
Entry - A single cell in the tile buffer — which tile to draw and with what ink.
- TilePos
- A position on the tile grid, measured in tiles.
Enums§
- Control
Action - Action produced when a control code is processed by the text provider.
- Dialog
Mode - The current operational mode of the dialog engine.
Traits§
- Text
Provider - The core abstraction for text encoding in a JRPG engine.