Expand description
Screens any game can use, each with rows, entries or a legend the game
gives: the layout_picker, the key_bindings screen, the
options screen and the player profiles screen. Each
says what it shows as plain data (a view) and a skin paints it
(glyph for glyphs).
Re-exports§
pub use crate::frame::draw::cut;
Modules§
- key_
bindings - The Key bindings screen: every action of the game’s rows
(
KeyRow) with itsSLOTSkey slots for the layout in use, or, on its controllerSide, itsSLOTSbutton slots. A row at the top switches between the two. Confirm on a slot captures the next key or button pressed into it; one taken from another slot moves; leaving is blocked while a required action has no key or no button; Restore defaults asks first. - layout_
picker - The first-launch “Pick your layout” screen: one panel per
Layoutthe keymap file lists, with a small keyboard diagram and a legend, both read from that layout’s bindings. A game’s options open it again to switch layout (LayoutPickerScreen::change). What the legend lists is the game’s (Legend). - options
- An options screen: the player’s settings one per row, changed with the
cursor’s left and right keys, and rows that do something (open a
screen, ask a question). The game gives the rows (
OptionRow), each a label key and a typed value: on or off (RowValue::Toggle), one of several (RowValue::Choice), a volume (RowValue::Volume), or something Confirm does (RowValue::Action). The engine’s own settings come as rows ready made (OptionRow::text_speed,OptionRow::fullscreen,OptionRow::frame_cap, the volumes,OptionRow::restore_defaults). - profiles
- A player profiles screen: the profiles, the one in use marked, then a
row that adds one. It lets the people who share a computer each keep
their own settings and saves under a name, on the
Ctxprofile functions (Ctx::add_profileand the rest).
Constants§
- TEXT_
BOX_ HELP - The text key of a text box’s help line, with
{done},{delete}and{cancel}: the text box’s fixed keys.
Functions§
- centre_
x - Column at which
widthcells are centred inbuf(rounded left). - print_
centred - Prints
textcentred on rowy. A text wider thanbufstarts at column 0,cutto the buffer’s width. - text_
keys_ help - The help line of a text box:
Enter done · Backspace delete · Escape cancel, inctx’s language.