Skip to main content

Slider Widgets

Ctrl+Click on any slider to turn them into an input box. Manually input values aren’t clamped by default and can go off-bounds. Use ImGuiSliderFlags_AlwaysClamp to always clamp.

SliderFloat

Float slider widget.
const char*
Widget label
float*
Pointer to float value
float
Minimum value
float
Maximum value
const char*
default:"%.3f"
Display format string
ImGuiSliderFlags
default:"0"
Slider flags (see ImGuiSliderFlags_)
bool
True when value has been modified

SliderFloat2

Slider for 2 float values.

SliderFloat3

Slider for 3 float values.

SliderFloat4

Slider for 4 float values.

SliderInt

Integer slider widget.
const char*
Widget label
int*
Pointer to int value
int
Minimum value
int
Maximum value
const char*
default:"%d"
Display format string
ImGuiSliderFlags
default:"0"
Slider flags
bool
True when value has been modified

SliderInt2

Slider for 2 int values.

SliderInt3

Slider for 3 int values.

SliderInt4

Slider for 4 int values.

SliderAngle

Slider for angles (in radians).
const char*
Widget label
float*
Pointer to angle value in radians
float
default:"-360.0f"
Minimum angle in degrees
float
default:"+360.0f"
Maximum angle in degrees
const char*
default:"%.0f deg"
Display format
ImGuiSliderFlags
default:"0"
Slider flags
bool
True when value has been modified

VSliderFloat

Vertical slider for float values.
const char*
Widget label
const ImVec2&
Slider size
float*
Pointer to float value
float
Minimum value
float
Maximum value
const char*
default:"%.3f"
Display format
ImGuiSliderFlags
default:"0"
Slider flags
bool
True when value has been modified

VSliderInt

Vertical slider for int values.

Drag Widgets

Ctrl+Click on any drag box to turn them into an input box. Use ImGuiSliderFlags_AlwaysClamp to always clamp. Speed is per-pixel of mouse movement (v_speed=0.2f: mouse needs to move by 5 pixels to increase value by 1).

DragFloat

Drag to input float. If v_min >= v_max we have no bound.
const char*
Widget label
float*
Pointer to float value
float
default:"1.0f"
Speed of value change per pixel of mouse movement
float
default:"0.0f"
Minimum value (no bound if v_min >= v_max)
float
default:"0.0f"
Maximum value
const char*
default:"%.3f"
Display format
ImGuiSliderFlags
default:"0"
Slider flags
bool
True when value has been modified

DragFloat2

Drag to input 2 float values.

DragFloat3

Drag to input 3 float values.

DragFloat4

Drag to input 4 float values.

DragFloatRange2

Drag to input a range of float values.
const char*
Widget label
float*
Pointer to current minimum value
float*
Pointer to current maximum value
float
default:"1.0f"
Speed of value change
float
default:"0.0f"
Absolute minimum value
float
default:"0.0f"
Absolute maximum value
const char*
default:"%.3f"
Display format for min value
const char*
default:"NULL"
Display format for max value (uses format if NULL)
ImGuiSliderFlags
default:"0"
Slider flags
bool
True when value has been modified

DragInt

Drag to input int. If v_min >= v_max we have no bound.
const char*
Widget label
int*
Pointer to int value
float
default:"1.0f"
Speed of value change
int
default:"0"
Minimum value
int
default:"0"
Maximum value
const char*
default:"%d"
Display format
ImGuiSliderFlags
default:"0"
Slider flags
bool
True when value has been modified

DragInt2

Drag to input 2 int values.

DragInt3

Drag to input 3 int values.

DragInt4

Drag to input 4 int values.

DragIntRange2

Drag to input a range of int values.

Slider Flags

ImGuiSliderFlags_

Flags for DragFloat(), DragInt(), SliderFloat(), SliderInt() etc.