Skip to main content

Box and Frame

See the BoxDemo class.

Gui.Heading("Box");
// Allocate a 100x100 rectangle.
var boxRect = Ctx.AllocateRect(100f, 100f);
Gui.Box(boxRect);


Gui.Heading("Box(scope)");
// Start a box scope.
using (Gui.BeginBox())
{
Gui.Text("a");
Gui.Text("b");
Gui.Text("c");
}

Gui.Heading("Frame");
var frameRect = Ctx.AllocateRect(100f, 100f);
Gui.Frame(frameRect);

Gui.Heading("Box(scope) and Frame");
using (Gui.BeginBox())
{
Gui.Text("a");
Gui.Text("b");
Gui.Text("c");
}
//If you want to draw a box with a frame, use Box + Frame.
Gui.Frame(Ctx.GetLastWidgetRect());

Gui.Heading("FrameBox(scope)");
using (Gui.BeginFrameBox())
{
Gui.Text("a");
Gui.Text("b");
Gui.Text("c");
}