# UI

> The examples under examples/ui/.

Source: https://omardev29.github.io/rmp-docs/examples/ui/index.html

- [Menu](https://omardev29.github.io/rmp-docs/examples/ui/01_menu.html) — A main menu in three lines, then an options screen, a confirm dialog and a HUD — one scene per screen under `src/scenes/`, and `change<>()` between them.
- [Layout](https://omardev29.github.io/rmp-docs/examples/ui/02_layout.html) — `row`, `column`, `panel`, `center`, `stack`/`layer`, `spacer`, plus `image` and `progress`.
- [Clay direct](https://omardev29.github.io/rmp-docs/examples/ui/03_clay_direct.html) — **The escape hatch.** Clay's own macros in the same frame as `rmp::ui`, for anything the small API does not expose yet.
- [Settings](https://omardev29.github.io/rmp-docs/examples/ui/04_settings.html) — Checkbox, slider, dropdown, text input — and the focus/keyboard/gamepad navigation you get without writing any.
- [Inventory](https://omardev29.github.io/rmp-docs/examples/ui/05_inventory.html) — `grid` with a column count worked out from the space available, `scroll` with clipping, `tooltip()` for what each item is -- under a resting pointer or the keyboard's focus -- and `wants_pointer()` keeping the game's hands off the UI's clicks.
- [Style](https://omardev29.github.io/rmp-docs/examples/ui/06_style.html) — The two themes, the five variants, the three sizes and the transition.
- [Responsive](https://omardev29.github.io/rmp-docs/examples/ui/07_responsive.html) — `scale()` versus `current_breakpoint()`, and which to reach for.
- [Overlay](https://omardev29.github.io/rmp-docs/examples/ui/08_overlay.html) — `overlay()`: a pause menu pushed as a scene of its own, blurred, that freezes the game below; and "Really quit?" drawn by the game scene itself -- an overlay with a `panel()` in it, which is all a dialog is.
- [Skinned](https://omardev29.github.io/rmp-docs/examples/ui/09_skinned.html) — The other way to write `rmp::ui`: a game's shop screen designed rather than written.
- [Dialogue](https://omardev29.github.io/rmp-docs/examples/ui/10_dialogue.html) — **One Yarn conversation, three ways, switched while it runs**: a `DialogueBox` (a portrait, a name plate on the frame, a voice per `Speaker`), a `DialogueBubble` over whoever speaks with its tail pointing at them, and a `DialogueStage` whose cast slides in and comes forward, shaken by a `<<quake>>`.
- [Localization](https://omardev29.github.io/rmp-docs/examples/ui/11_localization.html) — **A lantern stall in English, Spanish, Japanese and German**, switched while it runs: every literal its own key in `resources/lang.tsv`, German in a file of its own (`lang/de.tsv`), `{placeholders}`, plurals in each language's forms, a context, and a font per language -- Japanese in Jigmo (CC0), cut down to the letters the table uses -- with each language's name in the menu in a font that has its letters (`Style::font`).
- [Font](https://omardev29.github.io/rmp-docs/examples/ui/12_font.html) — A menu in a font of your own: a title, its options and its credits, one scene each, every word in Hack Bold through one `rmp::ui::set_font()`.
