API reference
Preparing search index…

ImGui.SliderFloat

  • Edit a floating-point value with a slider.

    Parameters

    label
    string | Uint8Array

    Widget label; interactive widgets also use it for ID generation. A ## suffix can distinguish IDs without displaying the suffix.

    v
    Float32Array

    Mutable widget value in element [0]; edits are written back into the supplied array. Pass Float32Array storage, not a JS scalar; native access uses the supplied backing memory.

    v_min
    number

    Lower end of the value range; for drag widgets v_min >= v_max disables ordinary bounds.

    v_max
    number

    Upper end of the value range; slider flags determine whether manual input is clamped.

    Returns

    boolean

    True if the widget changed the supplied value; false if it remained unchanged.

    adjust format to decorate the value with a prefix or a suffix for in-slider labels or unit display.

    • 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.

    • Adjust format string to decorate the value with a prefix, a suffix, or adapt the editing and display precision e.g. "%.3f" -> 1.234; "%5.2 secs" -> 01.23 secs; "Biscuit: %.0f" -> Biscuit: 1; etc.

    • Format string may also be set to null or use the default format ("%f" or "%d").

    • Legacy: Pre-1.78 there are SliderXXX() function signatures that take a final float power=1.0 argument instead of the ImGuiSliderFlags flags=0 argument. If you get a warning converting a float to ImGuiSliderFlags, read https://github.com/ocornut/imgui/issues/3361

    Implied format = "%.3f", flags = 0

    Source & inheritance

Icons made by Lorc, Delapouite & Skoll · game-icons.net · CC BY 3.0