Expand description
Ctx: what every screen shares, passed &mut to
Screen::update and & to
Screen::draw. The engine’s services (text by
key in the player’s language, the keys and the names help text gives
them, the player’s settings and profiles, sounds, music and voices,
storage) and the game’s own part, Ctx::game, whose type says what
the engine reads from the game’s data (GameData).
A plain struct: no service locator, no globals. A game names its own
with an alias (type Ctx = shuyi_ui::Ctx<MyGame>). The engine’s
services are fields; a module’s state is found by its type
(Ctx::module_state), put there by its
install and listed.
Structs§
Enums§
- Idle
Motion - Whether screens show their idle motion (
Ctx::idle_motion). - KeyPrompt
- The “press any key or button” wait (
Ctx::key_prompt): browsers block sound until the player presses a key. - Keyboard
- Whether the platform has a keyboard
(
PlatformFacts::keyboard).
Constants§
- ARROWS_
TEXT - The text key of the arrow keys’ name in help text
(
ARROWS). - CHORD_
JOIN_ TEXT - The text key of what joins a button chord’s two buttons in help text
(
A+B). - DEBUG_
VIEW_ KEY - Key in the computer’s
Storage(not a profile’s) under which the debug view’s channels that are on are saved (DebugView::to_ron), only with debug tools on. - DEFAULT_
MUSIC_ SEED Ctx::music_seeduntil the platform sets it.- KEYBINDINGS_
KEY Storagekey under which the player’s key and controller-button bindings are saved (PlayerKeys::to_ron).- NOT_
MAPPED_ TEXT - The text key of what help text shows for an action with no key.
- PROFILE_
NUMBERED_ TEXT - The text key of a profile’s name when the player hasn’t named it:
Player {n}, made on a first launch.