On this page
  1. row
  2. box
  3. background
  4. id
  5. style
  6. children
  7. on_click
  8. on_hover
  9. on_unhover
  10. on_press
  11. on_release
  12. show, shake, hovered, pressed
  13. ours

rmp::ui::Panel

struct #include <rmp/ui.h> include/rmp/ui.h:1827
struct Panel

A container: a panel with a look of its own (style), and a look for everything inside it (children), which every descendant inherits — the nearest container's wins. Clickable as a whole when it has an on_click: an inventory slot, a card.

rmp::ui::Panel shop{
    .style = { .background = DARKBROWN, .shadow = rmp::ui::Shadow{} },
    .children = { .text = GOLD, .font = title_font },
};
shop.show([&] { buy.show(); sell.show(); });

row

bool row = false

Children left to right; false = top to bottom

box

BoxOptions box{}

Its layout, as panel() takes it

background

bool background = true

False: a bare row or column, which still styles its children

id

std::string id{}

As ButtonOptions::id: for a shared label

style

Style style{}

Its own look; see Style

children

Style children{}

The look of everything inside it

on_click

rmp::Callback<> on_click

Clicked: released on it, or Enter or A with the focus

on_hover

rmp::Callback<> on_hover

The pointer arrived on it

on_unhover

rmp::Callback<> on_unhover

...and left

on_press

rmp::Callback<> on_press

The pointer went down on it

on_release

rmp::Callback<> on_release

...and came up

show, shake, hovered, pressed

template <class Body> bool show(Body &&body)
void shake()
bool hovered() const
bool pressed() const

Lays it out with body inside it; true on the frame it was clicked.

show: Lays it out here

shake: Shakes it, as Button::shake() does

hovered: The pointer is on it

pressed: Held down on it

ours

KeptState ours

What it remembers; read it with the methods above