The length of the text label in a SliderFloat() widget is added as padding after the slider
This makes aligning text to the right of sliders difficult, as there can be a large gap between the slider and the following text
The length of the text label in a SliderFloat() widget is added as padding after the slider
This makes aligning text to the right of sliders difficult, as there can be a large gap between the slider and the following text
Use the following code:
DbgUI.Begin("Slider padding test", 100, 100); float test1, test2, test3; // The gap between the slider and the 2nd text changes as the slider label length changes DbgUI.PushID(1); DbgUI.SliderFloat("text", test1, 0.0, 100.0, 200); DbgUI.SameLine(); DbgUI.Text(test1.ToString()); DbgUI.SliderFloat("more text", test2, 0.0, 100.0, 200); DbgUI.SameLine(); DbgUI.Text(test2.ToString()); DbgUI.SliderFloat("even more text here", test3, 0.0, 100.0, 200); DbgUI.SameLine(); DbgUI.Text(test3.ToString()); DbgUI.PopID(); DbgUI.Spacer(30); // Aligning the sliders makes the padding after each slider become huge DbgUI.PushID(2); DbgUI.SliderFloat("text ", test1, 0.0, 100.0, 200); DbgUI.SameLine(); DbgUI.Text(test1.ToString()); DbgUI.SliderFloat("more text ", test2, 0.0, 100.0, 200); DbgUI.SameLine(); DbgUI.Text(test2.ToString()); DbgUI.SliderFloat("even more text here", test3, 0.0, 100.0, 200); DbgUI.SameLine(); DbgUI.Text(test3.ToString()); DbgUI.PopID(); DbgUI.End();