UIDropdown Class
Definition
Namespace: Brine2D.UI
Dropdown/ComboBox UI component for selecting from a list of options.
Inheritance System.Object → UIDropdown
Implements IUIComponent
| Properties | |
|---|---|
| BackgroundColor | Background color. |
| BorderColor | Border color. |
| HoverColor | Hover color for items. |
| IsExpanded | Whether the dropdown list is currently expanded. |
| Items | List of items in the dropdown. |
| MaxVisibleItems | Maximum number of visible items before scrolling \(0 = show all\). |
| SelectedColor | Selected item color. |
| SelectedIndex | Currently selected item index \(\-1 = none selected\). |
| SelectedText | Currently selected item text \(null if none selected\). |
| TextColor | Text color. |
| Methods | |
|---|---|
| AddItem\(string\) | Adds an item to the dropdown. |
| ClearItems() | Clears all items. |
| Close() | Called by UICanvas to close the dropdown. |
| RemoveItem\(string\) | Removes an item from the dropdown. |
| SelectItem\(Vector2\) | Called by UICanvas when an item is clicked. |
| Toggle() | Called by UICanvas when dropdown is clicked. |
| UpdateHover\(Vector2\) | Called by UICanvas to update hover state. |
| Events | |
|---|---|
| OnSelectionChanged | Event fired when selection changes. |