Skip to main content

Module widgets

Module widgets 

Source
Expand description

Reusable pieces screens are built from: a menu, the ListCursor that moves its focus (and any other list’s), a question over the screen (Ask), a name typed or spelled on a letter grid (name_entry) and word_wrap for text boxes. Each widget says what it shows as plain data (a view) and a skin paints it (menu::glyph and ask::glyph for glyphs).

Re-exports§

pub use ask::AnswerView;
pub use ask::Ask;
pub use ask::AskView;
pub use list::ListCursor;
pub use list::Scroll;
pub use menu::Menu;
pub use menu::MenuEvent;
pub use menu::MenuItem;
pub use menu::MenuItemView;
pub use menu::MenuView;
pub use name_entry::NameBox;
pub use name_entry::NameEntry;
pub use name_entry::NameEvent;
pub use name_entry::NameRules;

Modules§

ask
A question over the screen: a line of text and the answers to it, one in focus (“Keep these changes? Keep · Discard · Back”), or a yes/no answered by Confirm and Cancel alone, its keys named under it (Ask::yes_no).
list
A cursor over a list: the focus that moves up and down n rows, and the window of rows a box shows when the list is longer than the box.
menu
A vertical list menu: a title screen’s, an action menu, a list of replies.
name_entry
Typing a name: a player profile’s, a hero’s, a farm’s.

Functions§

word_wrap
Splits text into lines of at most width cells (a character widths has wide takes two, text_width).