Skip to content

UICheckbox Class

Definition

Namespace: Brine2D.UI

Checkbox UI component for toggle/boolean values.

C#
public class UICheckbox : Brine2D.UI.IUIComponent, Brine2D.UI.IAnchoredUIComponent

Inheritance System.Object → UICheckbox

Implements IUIComponent, IAnchoredUIComponent

Properties
Anchor The screen anchor point this component is positioned relative to.
AnchorOffset Pixel offset from the resolved anchor point.
BorderColor Border color.
BoxSize Size of the checkbox square in pixels. Updates Size automatically.
CheckedColor Checked box color.
CheckmarkColor Checkmark color.
FocusColor Color of the focus ring drawn around the box when the checkbox has keyboard focus.
Font Optional font for label rendering \(null = renderer default\).
HoverColor Hover box color.
IsChecked Whether the checkbox is checked.
IsFocused Whether this checkbox currently has keyboard focus.
Label Checkbox label text. Changing this updates Size automatically.
LabelColor Label text color.
LabelSpacing Spacing between box and label.
Size Hit-test size, derived from BoxSize and Label.
UncheckedColor Unchecked box color.
Methods
SetFocused\(bool\) Called by UICanvas to set keyboard focus on this checkbox.
SetHovered\(bool\) Called by UICanvas when mouse hovers over checkbox.
Toggle() Called by UICanvas when checkbox is clicked.
Events
OnCheckedChanged Event fired when checked state changes.
OnFocusGained Event fired when this checkbox gains keyboard focus.
OnFocusLost Event fired when this checkbox loses keyboard focus.
OnHoverEnter Event fired when the mouse cursor enters the checkbox bounds.
OnHoverExit Event fired when the mouse cursor leaves the checkbox bounds.