Slider class
#include <Jazz2/UI/Menu/MenuWidgets.h>
Setting row with a value bar adjusted left/right.
Draws a label above a 33-block bar showing a [0, 1] value. Left/Right (held, with hold-to-accelerate) adjust the value through the OnAdjust callback; touching the left/right half of the bar nudges it. Used for the audio volume sliders.
Base classes
- class Widget
- Base class of a menu widget.
Constructors, destructors, conversion operators
- Slider(StringView label, Function<float()> value, Function<void(float)> onAdjust)
Public functions
- auto GetHeight() const -> float override
- Returns the height the widget occupies in a vertical layout.
- void OnUpdate(float timeMult) override
- Advances the widget's animations.
-
void Draw(IMenuContainer* root,
Canvas* canvas,
const Rectf& bounds,
std::
int32_t& charOffset) override - Draws the widget within the given bounds.
- auto OnNavigate(const WidgetInput& input, IMenuContainer* root) -> bool override
- Handles navigation input; returns
trueif it was consumed. -
auto OnTouchEvent(const nCine::
TouchEvent& event, Vector2i viewSize, IMenuContainer* root) -> bool override - Handles a touch event; returns
trueif it was consumed. - void OnSelected() override
- Called when the widget becomes selected.