Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No way to remove text from slider #6692

Closed
OneAvargeCoder193 opened this issue Aug 5, 2023 · 2 comments
Closed

No way to remove text from slider #6692

OneAvargeCoder193 opened this issue Aug 5, 2023 · 2 comments
Labels
label/id and id stack implicit identifiers, pushid(), id stack

Comments

@OneAvargeCoder193
Copy link

Version/Branch of Dear ImGui:

Version: 1.89.9
Branch: master

My Issue/Question:

Is there any way to make a slider without any text? I was looking through the backends and there wasn't any flag for this. I don't know if this is added already or if it isnt a feature in Dear ImGui yet.

Maybe something like this could work?

ImGui::SliderFloat("Labelless slider", &x, 0, 1, "%.3f", ImGuiSliderFlags_NoLabel)
@sakiodre
Copy link
Contributor

sakiodre commented Aug 5, 2023

Any text after "##" will be hidden, use it as an unique id:

ImGui::SliderFloat("##Labelless slider", &x, 0, 1, "%.3f");

@ocornut ocornut added the label/id and id stack implicit identifiers, pushid(), id stack label Aug 5, 2023
@ocornut
Copy link
Owner

ocornut commented Aug 5, 2023

You may read more about this in the FAQ under "How can I have widgets with an empty label?"
https://github.com/ocornut/imgui/blob/master/docs/FAQ.md#q-how-can-i-have-widgets-with-an-empty-label

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
label/id and id stack implicit identifiers, pushid(), id stack
Projects
None yet
Development

No branches or pull requests

3 participants