Slider
See the SliderDemo.cs.
namespace Gridrand.RimGui.Manual
{
/// <summary>
/// Demonstrates the use of various sliders for different numeric types.
/// </summary>
class SliderDemo : ManualBase, IManual
{
float floatValue0 = 1f;
float floatValue1 = 50f;
float floatValue2 = 10000f;
float floatValue3 = 0f;
public SliderDemo(ManualBaseResource p) : base(p)
{
}
public void Draw()
{
// Draw and control a floating-point value between 0 and 1
Gui.Text($"0~1");
Gui.Text($"{floatValue0:F2}");
Gui.Slider(ref floatValue0, 0f, 1f);
Gui.Separator();
// Draw and control a floating-point value between 0 and 100
Gui.Text($"0~100");
Gui.Text($"{floatValue1:F2}");
Gui.Slider(ref floatValue1, 0f, 100f);
Gui.Separator();
// Draw and control a floating-point value between 0 and 10000
Gui.Text($"0~10000");
Gui.Text($"{floatValue2:F2}");
Gui.Slider(ref floatValue2, 0f, 10000f);
// Draw and control a floating-point value between -10000 and 10000
Gui.Text($"-10000~10000");
Gui.Text($"{floatValue3:F2}");
Gui.Slider(ref floatValue3, -10000f, 10000f);
}
}
}