Skip to main content

Padding

padding

Padding allows you to add space around a Widget.

See the PaddingDemo.cs.

using Gridrand.Contracts;
namespace Gridrand.RimGui.Manual
{
/// <summary>
/// Demo of <see cref="Context.BeginPadding(Padding)"/>.
///
/// Padding allows you to add space around a Widget.
/// </summary>
class PaddingDemo : ManualBase, IManual
{
public PaddingDemo(ManualBaseResource p) : base(p)
{
}

public void Draw()
{
Gui.NextWidth(100).Button("0");

// The Padding inside this scope will be applied with the specified values.
using (Ctx.BeginPadding(new Padding(30f, 10f, 10f, 10f)))
{
Gui.NextWidth(100).Button("1");

// Can be nested
using (Ctx.BeginPadding(new Padding(30f, 30f, 30f, 30f)))
{
Gui.NextWidth(100).Button("2");
}

Gui.NextWidth(100).Button("3");
}
Gui.NextWidth(100).Button("4");
}
}
}