Class ListBox<T>
Assembly: PopcorningGuineaPig.Engine.dll
Syntax
public class ListBox<T> : InteractiveUIElement, IUIElement
Type Parameters
Constructors
|
Edit this page
View Source
ListBox(Vector2, Vector2)
Declaration
public ListBox(Vector2 position, Vector2 size)
Parameters
Methods
|
Edit this page
View Source
AddItem(T)
Declaration
public void AddItem(T item)
Parameters
| Type |
Name |
Description |
| T |
item |
|
|
Edit this page
View Source
ClearItems()
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
EnsureItemVisible(int)
Declaration
public void EnsureItemVisible(int index)
Parameters
| Type |
Name |
Description |
| int |
index |
|
|
Edit this page
View Source
GetPlaceholderText()
Declaration
public string GetPlaceholderText()
Returns
|
Edit this page
View Source
GetSelectedIndex()
Declaration
public int GetSelectedIndex()
Returns
|
Edit this page
View Source
GetSelectedItem()
Declaration
public T GetSelectedItem()
Returns
|
Edit this page
View Source
IsFocused()
Declaration
Returns
|
Edit this page
View Source
RemoveItem(T)
Declaration
public void RemoveItem(T item)
Parameters
| Type |
Name |
Description |
| T |
item |
|
|
Edit this page
View Source
SetColors(Color, Color, Color, Color, Color, Color)
Declaration
public void SetColors(Color backgroundColor, Color textColor, Color borderColor, Color highlightColor, Color selectedItemColor, Color inactiveSelectedColor)
Parameters
| Type |
Name |
Description |
| Color |
backgroundColor |
|
| Color |
textColor |
|
| Color |
borderColor |
|
| Color |
highlightColor |
|
| Color |
selectedItemColor |
|
| Color |
inactiveSelectedColor |
|
|
Edit this page
View Source
SetCustomItemRenderer(Action<T, Rectangle, bool>?)
Declaration
public void SetCustomItemRenderer(Action<T, Rectangle, bool>? renderer)
Parameters
| Type |
Name |
Description |
| Action<T, Rectangle, bool> |
renderer |
|
|
Edit this page
View Source
SetFontSize(int)
Declaration
public void SetFontSize(int fontSize)
Parameters
| Type |
Name |
Description |
| int |
fontSize |
|
|
Edit this page
View Source
SetItemHeight(int)
Declaration
public void SetItemHeight(int height)
Parameters
| Type |
Name |
Description |
| int |
height |
|
|
Edit this page
View Source
SetItems(List<T>)
Declaration
public void SetItems(List<T> newItems)
Parameters
| Type |
Name |
Description |
| List<T> |
newItems |
|
|
Edit this page
View Source
SetLocalizationService(ILocalizationService?)
Sets the localization service to use for automatic font management.
Override this method in derived classes that display text to implement localization support.
Default implementation does nothing (for non-text UI elements).
Declaration
public override void SetLocalizationService(ILocalizationService? localizationService)
Parameters
| Type |
Name |
Description |
| ILocalizationService |
localizationService |
The localization service to use, or null to disable
|
Overrides
|
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
SetPlaceholderText(string)
Declaration
public void SetPlaceholderText(string text)
Parameters
| Type |
Name |
Description |
| string |
text |
|
|
Edit this page
View Source
SetSelectedIndex(int)
Declaration
public void SetSelectedIndex(int index)
Parameters
| Type |
Name |
Description |
| int |
index |
|
|
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