monogame-ui-radiobutton
Installation
SKILL.md
MonoGame UI RadioButton
RadioButtons provide mutually exclusive selection within a named group. Selecting any button in a group automatically deselects all others. For complete code templates, read references/ui-radiobutton.md.
Assumed Contract
Extends UIElement from monogame-ui-core. Receives pointer events from monogame-ui-interaction. Participates in focus via monogame-ui-focus — arrow keys navigate between options in the same group.
RadioGroup
RadioGroup is the source of truth for selection — it is not a visual element. It:
- Holds a list of
RadioButtoninstances belonging to it - Tracks
SelectedButton(the currently checked one) - Provides
Select(button)which deselects all others and selects the given one - Fires
SelectionChanged(RadioGroup, RadioButton)
Registration: Pass the group to the button's constructor — buttons register themselves automatically. Never manage selection state inside individual buttons — always delegate to the group.