Classes

UI/Slider

Brief descriptions

Detailed information

ui::NauSlider

engine/core/modules/ui/include/nau/ui/slider.h

class NauSlider : public nau::ui::UIControl

Public Types

using OnValueChangedCallback = std::function<void(float value)>

Public Functions

NauSlider()
virtual ~NauSlider()
inline FORCEINLINE void setOnValueChangedCallback (OnValueChangedCallback cb)
void setTrackSprite(const eastl::string &filename)
void setThumbSprite(const eastl::string &filename)

Public Static Functions

static NauSlider *create()

Protected Functions

virtual bool initialize() override

Protected Attributes

OnValueChangedCallback m_onValueChanged = {nullptr}

Private Functions

void updateThumb()
void updateTrack()
void processSliderInput(const math::vec2 &inputPosition)
float positionToValue(math::vec2 inputValue)
float valueToPosition(float value)

Private Members

Sprite *m_track = {nullptr}
Sprite *m_thumb = {nullptr}
float m_currentValue = {1.0f}