MenuItemConfig Class
Fluent configuration for menu item GameObjects. More...
Declaration
Public Constructors Index
| MenuItemConfig (helios::engine::ecs::GameObject gameObject, helios::engine::ecs::GameObject &parentMenu) | |
|
Constructs a MenuItemConfig for the given GameObject. More... | |
Public Member Functions Index
| MenuItemConfig & | selected (const bool isSelected) |
|
Sets the selected state. More... | |
| MenuItemConfig & | normalColor (const helios::math::vec4f color) |
|
Sets the normal state color. More... | |
| MenuItemConfig & | normalScale (const float scale) |
|
Sets the normal state scale. More... | |
| MenuItemConfig & | selectedColor (helios::math::vec4f color) |
|
Sets the selected state color. More... | |
| MenuItemConfig & | selectedScale (const float scale) |
|
Sets the selected state scale. More... | |
| MenuItemConfig & | actionId (const helios::engine::modules::ui::widgets::types::ActionId actionId) |
|
Sets the action ID for this menu item. More... | |
| MenuItemConfig & | index (const size_t index) |
|
Sets the index position in the parent menu. More... | |
Private Member Functions Index
| void | attach () |
|
Attaches this item to the parent menu. More... | |
Private Member Attributes Index
| helios::engine::ecs::GameObject | gameObject_ |
|
The GameObject being configured. More... | |
| helios::engine::ecs::GameObject * | parentMenu_ = nullptr |
|
Pointer to the parent menu GameObject. More... | |
| std::optional< size_t > | index_ = std::nullopt |
|
Optional index position in the menu. More... | |
| bool | isSelected_ = false |
|
Whether this item is selected. More... | |
Description
Fluent configuration for menu item GameObjects.
Provides a builder-style interface for configuring menu items including styling, selection state, and action binding. Automatically attaches the item to the parent menu.
Definition at line 33 of file MenuItemConfig.ixx.
Public Constructors
MenuItemConfig()
| inline explicit |
Constructs a MenuItemConfig for the given GameObject.
Automatically adds UiStyleComponent and UiStateComponent, and attaches the item to the parent menu.
- Parameters
-
<a href="/docs/helios/namespaces/helios/engine/builder/gameobject">gameObject</a> The GameObject to configure.
parentMenu The parent menu GameObject (must have MenuComponent).
Definition at line 78 of file MenuItemConfig.ixx.
Referenced by actionId, index, normalColor, normalScale, selected, selectedColor and selectedScale.
Public Member Functions
actionId()
| inline |
Sets the action ID for this menu item.
- Parameters
-
actionId The action to trigger when activated.
- Returns
Reference to this config for method chaining.
Definition at line 180 of file MenuItemConfig.ixx.
References actionId and MenuItemConfig.
Referenced by actionId.
index()
| inline |
Sets the index position in the parent menu.
- Parameters
-
index The index position.
- Returns
Reference to this config for method chaining.
Definition at line 194 of file MenuItemConfig.ixx.
References index and MenuItemConfig.
Referenced by index.
normalColor()
| inline |
Sets the normal state color.
- Parameters
-
color The RGBA color.
- Returns
Reference to this config for method chaining.
Definition at line 124 of file MenuItemConfig.ixx.
Reference MenuItemConfig.
normalScale()
| inline |
Sets the normal state scale.
- Parameters
-
scale The scale factor.
- Returns
Reference to this config for method chaining.
Definition at line 138 of file MenuItemConfig.ixx.
Reference MenuItemConfig.
selected()
| inline |
Sets the selected state.
- Parameters
-
isSelected True if this item should be selected.
- Returns
Reference to this config for method chaining.
Definition at line 101 of file MenuItemConfig.ixx.
Reference MenuItemConfig.
selectedColor()
| inline |
Sets the selected state color.
- Parameters
-
color The RGBA color.
- Returns
Reference to this config for method chaining.
Definition at line 152 of file MenuItemConfig.ixx.
Reference MenuItemConfig.
selectedScale()
| inline |
Sets the selected state scale.
- Parameters
-
scale The scale factor.
- Returns
Reference to this config for method chaining.
Definition at line 166 of file MenuItemConfig.ixx.
Reference MenuItemConfig.
Private Member Functions
attach()
| inline |
Attaches this item to the parent menu.
Definition at line 58 of file MenuItemConfig.ixx.
Private Member Attributes
gameObject_
|
The GameObject being configured.
Definition at line 38 of file MenuItemConfig.ixx.
index_
|
Optional index position in the menu.
Definition at line 48 of file MenuItemConfig.ixx.
isSelected_
|
Whether this item is selected.
Definition at line 53 of file MenuItemConfig.ixx.
parentMenu_
|
Pointer to the parent menu GameObject.
Definition at line 43 of file MenuItemConfig.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.