Skip to content

API reference

Class Panel

Namespace: MicroEngine.UI
Assembly: MicroEngine.UI.dll
Guide: UI widgets

A box behind one child, with padding around it: the frame of a menu, a dialog or a HUD block.

C#
public sealed class Panel : Widget

Inheritance

object ← Widget ← Panel

Inherited Members

Widget.Measure(UiContext), Widget.Arrange(RectF, UiContext), Widget.Draw(IRenderer, UiContext), Widget.Bounds, Widget.Visible, Widget.Enabled, Widget.Width, Widget.Height, Widget.Offset, Widget.Opacity, Widget.BlocksPointer, Widget.Parent, Widget.Root, Widget.Children, Widget.Focusable, Widget.ClipsChildren, Widget.IsFocused, Widget.IsHovered, Widget.IsPressed, Widget.IsEnabledInTree, Widget.IsVisibleInTree, object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

Panel(Widget?)

A panel around content (optional).

C#
public Panel(Widget? content = null)

Parameters

content Widget?

Properties

Children

The widgets this one contains, in focus and drawing order.

C#
public override IReadOnlyList<Widget> Children { get; }

Property Value

IReadOnlyList<Widget>

Content

The widget inside, or null for an empty box.

C#
public Widget? Content { get; set; }

Property Value

Widget?

Padding

Space between the edge and the content in UI units; null (the default) is 6 layout units.

C#
public float? Padding { get; set; }

Property Value

float?

Style

The box’s colours; null (the default) is the theme’s panel.

C#
public PanelStyle? Style { get; set; }

Property Value

PanelStyle?

Methods

ArrangeContent(RectF, UiContext)

Places the children within bounds; nothing by default.

C#
protected override void ArrangeContent(RectF bounds, UiContext context)

Parameters

bounds RectF

context UiContext

DrawContent(IRenderer, UiContext)

Draws the widget in Bounds, and its children.

C#
protected override void DrawContent(IRenderer renderer, UiContext context)

Parameters

renderer IRenderer

context UiContext

MeasureContent(UiContext)

The size the widget’s content needs, in UI units.

C#
protected override Vector2 MeasureContent(UiContext context)

Parameters

context UiContext

Returns

Vector2