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.
public sealed class Panel : WidgetInheritance
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).
public Panel(Widget? content = null)Parameters
content Widget?
Properties
Children
The widgets this one contains, in focus and drawing order.
public override IReadOnlyList<Widget> Children { get; }Property Value
Content
The widget inside, or null for an empty box.
public Widget? Content { get; set; }Property Value
Padding
Space between the edge and the content in UI units; null (the default) is 6 layout units.
public float? Padding { get; set; }Property Value
Style
The box’s colours; null (the default) is the theme’s panel.
public PanelStyle? Style { get; set; }Property Value
Methods
ArrangeContent(RectF, UiContext)
Places the children within bounds; nothing by default.
protected override void ArrangeContent(RectF bounds, UiContext context)Parameters
bounds RectF
context UiContext
DrawContent(IRenderer, UiContext)
Draws the widget in Bounds, and its children.
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.
protected override Vector2 MeasureContent(UiContext context)Parameters
context UiContext