53 void GetPosition(
float &x,
float &y)
const override;
56 void SetSize(
float width,
float height)
override;
59 void GetSize(
float &width,
float &height)
const override;
83 [[nodiscard]]
float GetValue()
const override;
98 [[nodiscard]]
bool IsEnabled()
const override;
Abstract interface for graphics rendering operations.
Abstract interface for UI sliders.
Raylib implementation of the ISlider interface.
void Render() override
Render the slider.
~RaylibSlider() override=default
Destroy the RaylibSlider.
void SetMinValue(float minValue) override
Set the minimum value.
void SetValue(float value) override
Set the current value.
void SetHandleHoverColor(unsigned int color) override
Set the handle hover color.
void SetOnValueChanged(std::function< void(float)> callback) override
Set callback invoked when value changes.
std::function< void(float)> _onValueChanged
Align GetAlign() const override
Get the current alignment mode.
void SetEnabled(bool enabled) override
Enable or disable the slider.
unsigned int _handleColor
bool IsMouseOverTrack() const
Check whether the mouse cursor is over the track.
unsigned int _handleHoverColor
void Update() override
Update the slider internal state (hover, drag).
unsigned int _filledColor
bool IsEnabled() const override
Check if the slider is enabled.
void SetSize(float width, float height) override
Set the slider size.
void SetFilledColor(unsigned int color) override
Set the filled track color (portion before handle).
void ApplyAlignment() override
Apply the current alignment mode to the position.
void ClampValue()
Clamp value to [min, max] range.
static constexpr float TRACK_HEIGHT_RATIO
bool IsMouseOverHandle() const
Check whether the mouse cursor is over the handle.
static constexpr float HANDLE_RADIUS
void SetTrackColor(unsigned int color) override
Set the track color (unfilled portion).
void SetAlign(Align align) override
Set alignment mode relative to the window.
void UpdateValueFromMouse()
Update value based on mouse position.
void SetHandleColor(unsigned int color) override
Set the handle color.
void GetSize(float &width, float &height) const override
Get the current size of the slider.
void GetPosition(float &x, float &y) const override
Get the current top-left position of the slider.
void SetMaxValue(float maxValue) override
Set the maximum value.
Graphics::IGraphics & _graphics
float GetValue() const override
Get the current value.
void SetPosition(float x, float y) override
Set the top-left position of the slider.
Align
Alignment modes relative to the current window.