Skip to main content

Style

See the StyleDemo class.


// It allows you to disable widgets, making them unresponsive to input.
void DrawUsingDisabledScope()
{
Gui.LabelInputBool("Disabled", ref isDisabled);

using (Gui.BeginFrame())
{
// Within this scope, widgets are enabled or disabled based on isDisabled.
using (Style.BeginDisabled(isDisabled))
{
// When disabled, this button cannot be clicked.
if (Gui.TextButton("Button"))
{
Logger.Debug("Pressed Button");
}

if (Gui.FoldoutText("Foldout"))
{
using (Ctx.Indent())
Gui.LabelSlider("Slider int", ref sliderInt, 0, 100);
}
}
}
}

void DrawUsingScaleFactor()
{
Gui.LabelSlider("ScaleFactor", ref scaleFactor, 0.1f, 5f);

// The size of all widgets can be scaled.
using (Style.ScaleFactors.Begin(scaleFactor))
{
Gui.Text("ABC");
isChecked = Gui.RadioButton(isChecked);
}
}