ImGUI Sliders stuck with same value

Patch is sort of corrupted. Slider are stuck to the same value.
Preview 2022.5.0-0280
ImGuiTest.vl (38.5 KB)

this issue comes from a rather unfortunate behavior of imgui: widgets need unique labels to work. in your example both sliders have the label “Float”. if you change one, it works as expected.

Hey there,

Running into the same issue, does this mean there is absolutely no solution if I want to have a GUI with multiple buttons labelled “…” ?

image

Coming up with a different (longer) label for those seems a bit convoluted.

Thanks in advance!

seb

1 Like

This is possible by using ImGui’s ID system, for example “Slider##1” and “Slider##2” will both be labelled “Slider”. For reference see imgui/FAQ.md at master · ocornut/imgui · GitHub

We generate ids automatically if you don’t provide a name at all. Otherwise we take the one you give us. There might be cases where auto id generation gets in your way - at least we didn’t want to commit to such a behaviour too early.

1 Like

Thanks, the ## thing works just fine! Could there be a help patch about that?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.