Skip to main content

Label

See the LabelDemo class.

public void Draw()
{
Gui.Heading("Settings");

// Input for adjusting the label-to-input ratio
Gui.LabelInputFloat("Label Ratio", ref labelRatio, 0.1f, 0.9f);

// Apply label size ratio to all labeled inputs
using var s = Style.LabelSizes.Begin(Size.Ratio(labelRatio));

Gui.Separator();

// Various labeled UI components
Gui.LabelDropdown("Dropdown", ref sampleEnum);
Gui.LabelText("Text", "text");
Gui.LabelInputColor("InputColor", ref color);
Gui.LabelSlider("Slider 0-100", ref sliderIntValue, 0, 100);
Gui.LabelInputBool("InputBool", ref boolValue);
Gui.LabelInputNumeric("InputNumeric Int", ref numericIntValue);
Gui.LabelInputNumeric("InputNumeric Float", ref numericFloatValue);
Gui.LabelInputInt("InputInt 0-1", ref intValue1, 0, 1);
Gui.LabelInputInt("InputInt 0-100", ref intValue2, 0, 100);
Gui.LabelInputInt("InputInt 0-10000", ref intValue3, 0, 10000);
Gui.LabelInputFloat("InputFloat 0-100", ref floatValue, 0f, 100f);
Gui.LabelInputDouble("InputDouble 0-1000", ref doubleValue, 0d, 1000d);
Gui.LabelInputString("InputString", ref stringValue);
}

enum SampleEnum
{
A,
B,
C
}