UiTextComponent.ixx File
Component for displaying formatted text in the UI. More...
Included Headers
#include <cassert>
#include <format>
#include <memory>
#include <string>
#include <helios.engine.modules.rendering.renderable.components.RenderableComponent>
#include <helios.engine.ecs.GameObject>
#include <helios.core.units.Unit>
#include <helios.math.types>
#include <helios.rendering.text.TextRenderable>
Namespaces Index
| namespace | helios |
| namespace | engine |
|
Main engine module aggregating core infrastructure and game systems. More... | |
| namespace | modules |
|
Domain-specific components and systems. More... | |
| namespace | ui |
|
User interface components and systems for game entities. More... | |
| namespace | widgets |
|
UI widget components and systems. More... | |
| namespace | components |
|
UI widget state components. More... | |
Classes Index
| class | UiTextComponent |
|
Component for displaying formatted text in the UI. More... | |
Description
Component for displaying formatted text in the UI.
File Listing
The file content with the documentation metadata removed is:
25export namespace helios::engine::modules::ui::widgets::components {
34class UiTextComponent {
56 bool needsResize_ = true;
61 bool isEnabled_ = true;
72 return isEnabled_;
79 isEnabled_ = true;
86 isEnabled_ = false;
95 renderable_(renderable) {
97 assert(renderable_ != nullptr && "TextRenderable must not be nullptr");
105 UiTextComponent(const UiTextComponent& other) :renderable_(other.renderable_) {
106 assert(renderable_ != nullptr && "TextRenderable must not be nullptr");
109 UiTextComponent& operator=(const UiTextComponent&) = default;
110 UiTextComponent(UiTextComponent&&) noexcept = default;
111 UiTextComponent& operator=(UiTextComponent&&) noexcept = default;
118 [[nodiscard]] const helios::rendering::text::TextRenderable* renderable() const noexcept {
119 return renderable_;
127 [[nodiscard]] helios::rendering::text::TextRenderable* renderable() noexcept {
128 return renderable_;
135 isDirty_ = true;
144 reset();
153 reset();
163 if (!isDirty_) {
167 renderable_->setText(text_);
169 needsResize_ = true;
170 isDirty_ = false;
182 if (text == text_) {
185 text_ = text;
186 isDirty_ = true;
187 update();
196 if (text == text_) {
199 text_ = std::move(text);
200 isDirty_ = true;
201 update();
209 [[nodiscard]] bool needsResize() const noexcept {
210 return needsResize_;
216 void resizeComplete() noexcept {
217 needsResize_ = false;
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.