UiTextComponent Class
Component for displaying formatted text in the UI. More...
Declaration
Public Constructors Index
| UiTextComponent (helios::rendering::text::TextRenderable *renderable) | |
|
Constructs a UiTextComponent with the given renderable. More... | |
| UiTextComponent (const UiTextComponent &other) | |
|
Copy constructor. More... | |
| UiTextComponent (UiTextComponent &&) noexcept=default | |
Public Operators Index
| UiTextComponent & | operator= (const UiTextComponent &)=default |
| UiTextComponent & | operator= (UiTextComponent &&) noexcept=default |
Public Member Functions Index
| bool | isEnabled () const noexcept |
|
Checks whether this component is enabled. More... | |
| void | enable () noexcept |
|
Enables this component. More... | |
| void | disable () noexcept |
|
Disables this component. More... | |
| const helios::rendering::text::TextRenderable * | renderable () const noexcept |
|
Returns the underlying text renderable as const pointer. More... | |
| helios::rendering::text::TextRenderable * | renderable () noexcept |
|
Returns the underlying text renderable as a pointer. More... | |
| void | reset () noexcept |
|
Resets the component to its initial state. More... | |
| void | onAcquire () noexcept |
|
Called when the component is acquired from an object pool. More... | |
| void | onRelease () noexcept |
|
Called when the component is released back to an object pool. More... | |
| void | update () |
|
Updates the text content if dirty. More... | |
| void | setText (const std::string &text) |
|
Sets the text content and immediately updates the renderable. More... | |
| void | setText (std::string &&text) |
|
Sets the text content by move and immediately updates the renderable. More... | |
| bool | needsResize () const noexcept |
|
Checks if the AABB bounds need recalculation. More... | |
| void | resizeComplete () noexcept |
|
Marks the resize as complete. More... | |
Protected Member Attributes Index
| helios::rendering::text::TextRenderable * | renderable_ |
|
Pointer to the underlying text renderable. Not owned. More... | |
| std::string | text_ |
|
The current text content. More... | |
| bool | isDirty_ = true |
|
True if the text content needs to be updated. More... | |
| bool | needsResize_ = true |
|
True if the AABB bounds need to be recalculated. More... | |
| bool | isEnabled_ = true |
|
Whether this component is enabled. More... | |
Description
Component for displaying formatted text in the UI.
Wraps a TextRenderable and provides template-based value formatting. Supports dirty tracking to minimize rendering updates.
Definition at line 34 of file UiTextComponent.ixx.
Public Constructors
UiTextComponent()
| inline explicit |
Constructs a UiTextComponent with the given renderable.
- Parameters
-
renderable Pointer to the TextRenderable. Must not be nullptr.
Definition at line 94 of file UiTextComponent.ixx.
References renderable and renderable_.
Referenced by operator=, operator=, UiTextComponent and UiTextComponent.
UiTextComponent()
| inline |
Copy constructor.
- Parameters
-
other The component to copy from.
Definition at line 105 of file UiTextComponent.ixx.
References renderable_ and UiTextComponent.
UiTextComponent()
| noexcept default |
Definition at line 110 of file UiTextComponent.ixx.
Reference UiTextComponent.
Public Operators
operator=()
| default |
Definition at line 109 of file UiTextComponent.ixx.
Reference UiTextComponent.
operator=()
| noexcept default |
Definition at line 111 of file UiTextComponent.ixx.
Reference UiTextComponent.
Public Member Functions
disable()
| inline noexcept |
enable()
| inline noexcept |
isEnabled()
| inline nodiscard noexcept |
Checks whether this component is enabled.
- Returns
True if enabled, false otherwise.
Definition at line 71 of file UiTextComponent.ixx.
Reference isEnabled_.
needsResize()
| inline nodiscard noexcept |
Checks if the AABB bounds need recalculation.
- Returns
True if a resize is needed, false otherwise.
Definition at line 209 of file UiTextComponent.ixx.
Reference needsResize_.
onAcquire()
| inline noexcept |
onRelease()
| inline noexcept |
renderable()
| inline nodiscard noexcept |
Returns the underlying text renderable as const pointer.
- Returns
Const pointer to the TextRenderable. Never nullptr.
Definition at line 118 of file UiTextComponent.ixx.
References renderable and renderable_.
Referenced by renderable and UiTextComponent.
renderable()
| inline nodiscard noexcept |
Returns the underlying text renderable as a pointer.
- Returns
Pointer to the TextRenderable. Never nullptr.
Definition at line 127 of file UiTextComponent.ixx.
Reference renderable_.
reset()
| inline noexcept |
resizeComplete()
| inline noexcept |
Marks the resize as complete.
Definition at line 216 of file UiTextComponent.ixx.
Reference needsResize_.
setText()
| inline |
Sets the text content and immediately updates the renderable.
No-op if the new text is identical to the current content. Otherwise marks the component as dirty and calls update().
- Parameters
-
text The new text content.
Definition at line 181 of file UiTextComponent.ixx.
setText()
| inline |
Sets the text content by move and immediately updates the renderable.
Sets the text content and immediately updates the renderable.
No-op if the new text is identical to the current content. Otherwise marks the component as dirty and calls update().
- Parameters
-
text The new text content.
Definition at line 195 of file UiTextComponent.ixx.
update()
| inline |
Updates the text content if dirty.
Applies the template to the current value and updates the renderable.
Definition at line 161 of file UiTextComponent.ixx.
References isDirty_, needsResize_, renderable_ and text_.
Protected Member Attributes
isDirty_
| protected |
isEnabled_
| protected |
Whether this component is enabled.
Definition at line 61 of file UiTextComponent.ixx.
needsResize_
| protected |
True if the AABB bounds need to be recalculated.
Definition at line 56 of file UiTextComponent.ixx.
Referenced by needsResize, resizeComplete and update.
renderable_
| protected |
Pointer to the underlying text renderable. Not owned.
Definition at line 41 of file UiTextComponent.ixx.
Referenced by renderable, renderable, UiTextComponent, UiTextComponent and update.
text_
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.