Skip to main content

Module glyph

Module glyph 

Source
Expand description

The glyph look of a Menu: paints a MenuView as a single-line box of text rows with the focused one as a bar and, when its items have notes, the focused item’s note under a rule. A menu that scrolls shows its window, with a mark on the border where more items are out of the box. Everything about the look lives here; nothing here decides what the menu shows. Another look is another paint of the same view (game ADR-0054).

Functions§

paint
Paints view with its top-left corner at (x, y): a Panel box with a Border single line, items in Text, disabled ones in TextDim, and the focused one as a bar of panel text on Focus (on the border’s color for a disabled one: a menu that browses disabled items). Under the items, if any has a note: a border rule and the focused item’s note in text. A scrolled menu paints only the items it shows, with a ▲ in the top border if there are more above and a ▼ in the border under them if there are more below, in text. Labels are in the player’s language (Ctx::label).
size
Box size in cells: the widest label in the player’s language (or note, so the box keeps its width as the focus moves or the menu scrolls) plus a space and a border on each side, by one row per item shown plus the border, and a rule and a note row if any item has a note.
suffix_color
The colour of the text after a label: the warning colour for a warning, dim for an aside.