On this page
  1. text
  2. value
  3. placeholder
  4. max_length
  5. width
  6. enabled
  7. id
  8. style
  9. on_change
  10. on_hover
  11. on_unhover
  12. on_focus
  13. on_blur
  14. show
  15. shake
  16. hovered
  17. focused
  18. ours

rmp::ui::TextInput

struct #include <rmp/ui.h> include/rmp/ui.h:1921
struct TextInput

A text field that holds its own text.

text

rmp::Text text

The label

value

std::string value

What is typed

placeholder

rmp::Text placeholder{}

Shown, muted, while it is empty

max_length

int max_length = 0

In characters; 0 = no limit

width

float width = 0

Of the field, in design units; 0 = fill the space available

enabled

bool enabled = true

False = drawn disabled; no press, no change, no focus

id

std::string id{}

As ButtonOptions::id: for a shared label

style

Style style{}

Its own look; see Style

on_change

rmp::Callback<std::string_view> on_change

The text, after the change

on_hover

rmp::Callback<> on_hover

The pointer arrived on it

on_unhover

rmp::Callback<> on_unhover

...and left

on_focus

rmp::Callback<> on_focus

The keyboard or gamepad focus arrived

on_blur

rmp::Callback<> on_blur

...and left

show

bool show()

True on any frame the text changed

shake

void shake()

Shakes it, as Button::shake() does

hovered

bool hovered() const

The pointer is on it

focused

bool focused() const

It has the focus

ours

KeptState ours

What it remembers; read it with the methods above