Jazz2::UI::Menu::ListItem class

Selectable text item.

Single line of text that can be selected and activated. The selected item animates with the standard elastic pop and is drawn through IMenuContainer::DrawMenuListItem.

Base classes

class Widget
Base class of a menu widget.

Constructors, destructors, conversion operators

ListItem(StringView text, Function<void()> onActivate, float height = 40.0f)

Public functions

auto GetHeight() const -> float override
Returns the height the widget occupies in a vertical layout.
void OnUpdate(float timeMult) override
Advances the widget's animations.
void Draw(IMenuContainer* root, Canvas* canvas, const Rectf& bounds, std::int32_t& charOffset) override
Draws the widget within the given bounds.
void Activate(IMenuContainer* root) override
Called when the widget is activated (e.g., by Fire or a tap).
void OnSelected() override
Called when the widget becomes selected.

Public variables

String Text
Displayed text.
Function<void()> OnActivate
Invoked when the item is activated.
AnimatedValue Animation
Selection animation progress.
float Height
Height of the item row.