API reference
Preparing search index…

ImGui.DragFloat

  • Edit a floating-point value by dragging.

    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.

    Returns

    boolean

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

    • Pass a Float32Array with at least one element. The widget reads and updates v[0]. Vector variants require two, three, or four consecutive elements; use subarray() to select a region of an existing array.
    • This helper uses speed 1, no bounds, format "%.3f", and flags 0. Use DragFloatEx() to configure speed, bounds, format, and flags.
    • Ctrl+click switches to text input. In DragFloatEx(), bounds apply when v_min < v_max; ImGuiSliderFlags.AlwaysClamp also limits text input.
    • Speed is the change per pixel of mouse movement. For example, 0.2 changes the value by one after five pixels. Formatting controls displayed precision and may add a prefix or suffix, such as "%.2f secs".
    Source & inheritance

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