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

rmp::ui::Slider

struct #include <rmp/ui.h> include/rmp/ui.h:1872
struct Slider

A slider that holds its own value.

text

rmp::Text text

The label beside it

value

float value = 0

Its value, kept from min to max

min

float min = 0

The value at the left end

max

float max = 1

The value at the right end

step

float step = 0

As SliderOptions

width

float width = 0

0 = fill the space available

show_value

bool show_value = true

Draw the position, as a percentage, after the bar

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<float> on_change

The new value

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 that changed it

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