Class Dropdown<T>
Assembly: PopcorningGuineaPig.Engine.dll
Syntax
public class Dropdown<T> : InteractiveUIElement, IUIElement
Type Parameters
Constructors
|
Edit this page
View Source
Dropdown(Vector2, Vector2, List<T>, int)
Declaration
public Dropdown(Vector2 position, Vector2 size, List<T> options, int initialSelectedIndex = 0)
Parameters
Properties
|
Edit this page
View Source
SelectedIndex
Declaration
public int SelectedIndex { get; }
Property Value
Methods
|
Edit this page
View Source
Draw()
Declaration
|
Edit this page
View Source
DrawSelf()
Override DrawSelf to handle label drawing
Derived classes should call base.DrawSelf() to ensure labels are drawn
Declaration
protected override void DrawSelf()
Overrides
|
Edit this page
View Source
GetOptions()
Declaration
public List<T> GetOptions()
Returns
|
Edit this page
View Source
GetSelectedOption()
Declaration
public T GetSelectedOption()
Returns
|
Edit this page
View Source
SetColors(Color, Color, Color, Color)
Declaration
public void SetColors(Color backgroundColor, Color textColor, Color borderColor, Color highlightColor)
Parameters
| Type |
Name |
Description |
| Color |
backgroundColor |
|
| Color |
textColor |
|
| Color |
borderColor |
|
| Color |
highlightColor |
|
|
Edit this page
View Source
SetFontSize(int)
Declaration
public void SetFontSize(int fontSize)
Parameters
| Type |
Name |
Description |
| int |
fontSize |
|
|
Edit this page
View Source
SetLocalizationService(ILocalizationService?)
Sets the localization service to use for automatic font management.
Declaration
public override void SetLocalizationService(ILocalizationService? localizationService)
Parameters
Overrides
|
Edit this page
View Source
SetMaxVisibleItems(int)
Declaration
public void SetMaxVisibleItems(int maxItems)
Parameters
| Type |
Name |
Description |
| int |
maxItems |
|
|
Edit this page
View Source
SetOnSelectionChanged(Action<T>)
Declaration
public void SetOnSelectionChanged(Action<T> callback)
Parameters
| Type |
Name |
Description |
| Action<T> |
callback |
|
|
Edit this page
View Source
SetOptions(List<T>, int)
Declaration
public void SetOptions(List<T> newOptions, int initialSelectedIndex = 0)
Parameters
| Type |
Name |
Description |
| List<T> |
newOptions |
|
| int |
initialSelectedIndex |
|
|
Edit this page
View Source
SetSelectedIndex(int)
Declaration
public void SetSelectedIndex(int index)
Parameters
| Type |
Name |
Description |
| int |
index |
|
|
Edit this page
View Source
SetSelectedOption(T)
Declaration
public void SetSelectedOption(T value)
Parameters
| Type |
Name |
Description |
| T |
value |
|
|
Edit this page
View Source
Update()
Declaration
|
Edit this page
View Source
UpdateSelf()
Override UpdateSelf to provide common interactive element functionality
Derived classes should call base.UpdateSelf() before their own update logic
Declaration
protected override void UpdateSelf()
Overrides
Implements