monogame-ui-layout

Installation
SKILL.md

MonoGame UI Layout Engine

This skill covers the Measure & Arrange layout system that sits on top of UIElement from monogame-ui-core. For click/hover handling, see monogame-ui-interaction. For complete code templates, read references/ui-layout.md.

Assumed Contract

This skill extends UIElement defined in monogame-ui-core:

  • UIElement.Bounds (Rectangle) is the absolute screen rectangle set by the Arrange pass. Hit testing and rendering depend on it being up to date.
  • UIContainer.LayoutDirty flag triggers re-layout. It is set automatically on Add() / Remove().

The layout partial class lives in UIElement.Layout.cs and adds DesiredSize, Measure, and Arrange to the existing partial class.

The Two-Pass Model

Layout runs only when LayoutDirty == true — never unconditionally every frame.

Invalidation  →  Measure (bottom-up)  →  Arrange (top-down)
Installs
15
GitHub Stars
2
First Seen
May 20, 2026
monogame-ui-layout — alca259/monogame-skills