R-Type
Distributed multiplayer game engine in C++
Loading...
Searching...
No Matches
UI::ISlider Class Referenceabstract

Abstract interface for UI sliders. More...

#include <ISlider.hpp>

Inheritance diagram for UI::ISlider:
Inheritance graph
Collaboration diagram for UI::ISlider:
Collaboration graph

Public Member Functions

virtual ~ISlider ()=default
 Virtual destructor.
 
virtual void Update ()=0
 Update the slider internal state (hover, drag).
 
virtual void Render ()=0
 Render the slider.
 
virtual void SetOnValueChanged (std::function< void(float)> callback)=0
 Set callback invoked when value changes.
 
virtual void SetPosition (float x, float y)=0
 Set the top-left position of the slider.
 
virtual void GetPosition (float &x, float &y) const =0
 Get the current top-left position of the slider.
 
virtual void SetSize (float width, float height)=0
 Set the slider size.
 
virtual void GetSize (float &width, float &height) const =0
 Get the current size of the slider.
 
virtual void SetTrackColor (unsigned int color)=0
 Set the track color (unfilled portion).
 
virtual void SetFilledColor (unsigned int color)=0
 Set the filled track color (portion before handle).
 
virtual void SetHandleColor (unsigned int color)=0
 Set the handle color.
 
virtual void SetHandleHoverColor (unsigned int color)=0
 Set the handle hover color.
 
virtual void SetMinValue (float minValue)=0
 Set the minimum value.
 
virtual void SetMaxValue (float maxValue)=0
 Set the maximum value.
 
virtual void SetValue (float value)=0
 Set the current value.
 
virtual float GetValue () const =0
 Get the current value.
 
virtual void SetAlign (Align align)=0
 Set alignment mode relative to the window.
 
virtual Align GetAlign () const =0
 Get the current alignment mode.
 
virtual void ApplyAlignment ()=0
 Apply the current alignment mode to the position.
 
virtual void SetEnabled (bool enabled)=0
 Enable or disable the slider.
 
virtual bool IsEnabled () const =0
 Check if the slider is enabled.
 

Detailed Description

Abstract interface for UI sliders.

This interface defines a slider control with the following features:

  • Draggable handle to select a value within a range
  • Visual feedback (track, filled portion, handle)
  • Mouse interaction (click on track, drag handle)
  • Configurable range (min, max)
  • Configurable appearance (colors, sizes)
  • Optional callback on value change

Definition at line 30 of file ISlider.hpp.

Constructor & Destructor Documentation

◆ ~ISlider()

virtual UI::ISlider::~ISlider ( )
virtualdefault

Virtual destructor.

Member Function Documentation

◆ ApplyAlignment()

virtual void UI::ISlider::ApplyAlignment ( )
pure virtual

Apply the current alignment mode to the position.

Note
This modifies the position based on the align setting.

Implemented in UI::RaylibSlider.

◆ GetAlign()

virtual Align UI::ISlider::GetAlign ( ) const
pure virtual

Get the current alignment mode.

Returns
Alignment mode.

Implemented in UI::RaylibSlider.

◆ GetPosition()

virtual void UI::ISlider::GetPosition ( float &  x,
float &  y 
) const
pure virtual

Get the current top-left position of the slider.

Parameters
xOutput X position in pixels.
yOutput Y position in pixels.

Implemented in UI::RaylibSlider.

◆ GetSize()

virtual void UI::ISlider::GetSize ( float &  width,
float &  height 
) const
pure virtual

Get the current size of the slider.

Parameters
widthOutput width in pixels.
heightOutput height in pixels.

Implemented in UI::RaylibSlider.

◆ GetValue()

virtual float UI::ISlider::GetValue ( ) const
pure virtual

Get the current value.

Returns
Current value.

Implemented in UI::RaylibSlider.

◆ IsEnabled()

virtual bool UI::ISlider::IsEnabled ( ) const
pure virtual

Check if the slider is enabled.

Returns
true if enabled.

Implemented in UI::RaylibSlider.

◆ Render()

virtual void UI::ISlider::Render ( )
pure virtual

Render the slider.

Note
Must be called between the backend BeginDrawing/EndDrawing calls.

Implemented in UI::RaylibSlider.

◆ SetAlign()

virtual void UI::ISlider::SetAlign ( Align  align)
pure virtual

Set alignment mode relative to the window.

Parameters
alignAlignment mode.

Implemented in UI::RaylibSlider.

◆ SetEnabled()

virtual void UI::ISlider::SetEnabled ( bool  enabled)
pure virtual

Enable or disable the slider.

Parameters
enabledtrue to enable, false to disable.

Implemented in UI::RaylibSlider.

◆ SetFilledColor()

virtual void UI::ISlider::SetFilledColor ( unsigned int  color)
pure virtual

Set the filled track color (portion before handle).

Parameters
colorColor in ARGB format (0xAARRGGBB).

Implemented in UI::RaylibSlider.

◆ SetHandleColor()

virtual void UI::ISlider::SetHandleColor ( unsigned int  color)
pure virtual

Set the handle color.

Parameters
colorColor in ARGB format (0xAARRGGBB).

Implemented in UI::RaylibSlider.

◆ SetHandleHoverColor()

virtual void UI::ISlider::SetHandleHoverColor ( unsigned int  color)
pure virtual

Set the handle hover color.

Parameters
colorColor in ARGB format (0xAARRGGBB).

Implemented in UI::RaylibSlider.

◆ SetMaxValue()

virtual void UI::ISlider::SetMaxValue ( float  maxValue)
pure virtual

Set the maximum value.

Parameters
maxValueMaximum value.

Implemented in UI::RaylibSlider.

◆ SetMinValue()

virtual void UI::ISlider::SetMinValue ( float  minValue)
pure virtual

Set the minimum value.

Parameters
minValueMinimum value.

Implemented in UI::RaylibSlider.

◆ SetOnValueChanged()

virtual void UI::ISlider::SetOnValueChanged ( std::function< void(float)>  callback)
pure virtual

Set callback invoked when value changes.

Parameters
callbackFunction called when the slider value changes.

Implemented in UI::RaylibSlider.

◆ SetPosition()

virtual void UI::ISlider::SetPosition ( float  x,
float  y 
)
pure virtual

Set the top-left position of the slider.

Parameters
xX position in pixels.
yY position in pixels.

Implemented in UI::RaylibSlider.

◆ SetSize()

virtual void UI::ISlider::SetSize ( float  width,
float  height 
)
pure virtual

Set the slider size.

Parameters
widthWidth in pixels (track length).
heightHeight in pixels (track thickness).

Implemented in UI::RaylibSlider.

◆ SetTrackColor()

virtual void UI::ISlider::SetTrackColor ( unsigned int  color)
pure virtual

Set the track color (unfilled portion).

Parameters
colorColor in ARGB format (0xAARRGGBB).

Implemented in UI::RaylibSlider.

◆ SetValue()

virtual void UI::ISlider::SetValue ( float  value)
pure virtual

Set the current value.

Parameters
valueCurrent value (will be clamped to [min, max]).

Implemented in UI::RaylibSlider.

◆ Update()

virtual void UI::ISlider::Update ( )
pure virtual

Update the slider internal state (hover, drag).

Note
Should be called once per frame.

Implemented in UI::RaylibSlider.


The documentation for this class was generated from the following file: