Skip to main content

Module text

Module text 

Source
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 TextProvider implementation. 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::update processes one character per call, enabling the classic typewriter effect.

Structs§

DialogEngine
A general-purpose dialog engine that drives text display one character per frame.
DialogState
Full state of the dialog engine.
TextStream
A decoded character stream with a cursor for sequential reading.
TileBuffer
A configurable-width tile grid representing the text rendering surface.
TileEntry
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§

ControlAction
Action produced when a control code is processed by the text provider.
DialogMode
The current operational mode of the dialog engine.

Traits§

TextProvider
The core abstraction for text encoding in a JRPG engine.