Slider Widgets
SliderFloat()
Adjust a float value within a range:const char*
required
Widget label
float*
required
Pointer to the value to modify
float
required
Minimum and maximum values
const char*
default:"%.3f"
Display format string (printf-style)
SliderInt()
Adjust an integer value:SliderAngle()
Slider specialized for angles:Multi-Component Sliders
SliderFloat2/3/4()
Slide multiple float values:SliderInt2/3/4()
Slide multiple integer values:Vertical Sliders
VSliderFloat() / VSliderInt()
Vertical slider widgets:Drag Widgets
DragFloat()
Drag to adjust a float value:float
default:"1.0f"
Speed of value change per pixel of mouse movement
float
Optional range limits. Use
v_min >= v_max for no bounds.Drag widgets are useful when you need:
- Fine control over the value
- No strict visual bounds
- Keyboard/gamepad navigation with custom speed
DragInt()
Drag to adjust an integer value:Range Widgets
DragFloatRange2()
Drag a range with min/max values:DragIntRange2()
Slider and Drag Flags
Customize behavior with flags:Ctrl+Click to Input
By default, users can Ctrl+Click on sliders/drags to input values directly:Generic Scalar Widgets
DragScalar() / SliderScalar()
Work with any data type:Complete Example
Best Practices
For DragXXX widgets, set
v_min >= v_max to indicate no clamping bounds.