monogame-ui-controls
MonoGame UI Controls — Component Library
Ready-to-use UI components built on UIElement from monogame-ui-core. For layout positioning, see monogame-ui-layout. For click/hover events, see monogame-ui-interaction. For complete code templates, read references/ui-controls.md.
Assumed Contract
Controls in this skill extend
UIElement(partial class frommonogame-ui-core). They implementMeasure/Arrangefrommonogame-ui-layoutand receive pointer events via the hit test/bubbling system frommonogame-ui-interaction. If you need gamepad navigation, assign neighbor IDs and register withUIFocusManagerfrommonogame-ui-focus.
RasterizerStatefor scissor clipping is created once (in the constructor orLoadContent) — never insideDraw().
Label
Wraps SpriteFont.MeasureString to auto-size and supports horizontal/vertical alignment.
Measure: Call font.MeasureString(text), store as DesiredSize. Respect FixedSize if set.
Draw: Call spriteBatch.DrawString — position computed from Bounds + alignment offset.