|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
Configures Text widgets and registers them in the scene's entity registry. More...
#include <headers/guillaume/entities/text.hpp>


Public Member Functions | |
| Builder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Construct a builder holding the defaults of reset(). | |
| std::shared_ptr< Text > | buildEntity (void) override |
| Build a text from the current configuration, without registering it or giving it a parent. | |
| void | reset (void) override |
| Restore the defaults: empty content, role BodyMedium, no explicit font size, and the OnSurface color of the active theme. | |
| Builder & | withContent (const std::string &content) |
| Set the characters to draw. | |
| Builder & | withFontSize (const float &fontSize) |
| Override the role font size with an explicit size. | |
| Builder & | withTypeRole (theme::TypeRole role) |
| Set the typescale role and drop any explicit font size. | |
| Builder & | withColor (const utility::graphic::Color32Bit &color) |
| Set the text color. | |
| std::shared_ptr< Text > | makeText (std::shared_ptr< Entity > parent, const std::string &content, const float &fontSize, const utility::graphic::Color32Bit &color) |
| Build a text with an explicit font size, register it under parent and reset the builder. | |
| std::shared_ptr< Text > | makeText (std::shared_ptr< Entity > parent, const std::string &content, theme::TypeRole role, const utility::graphic::Color32Bit &color) |
| Build a text styled by a typescale role, register it under parent and reset the builder. | |
| Public Member Functions inherited from guillaume::entities::EntityBuilderBase< Text > | |
| EntityBuilderBase (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Construct a builder bound to two registries. | |
| ~EntityBuilderBase (void) override=default | |
| Default destructor. | |
| std::shared_ptr< Text > | registerEntity (std::shared_ptr< ecs::Entity > parent) |
| Build the widget, attach it to its parent, hand it to the entity registry, then reset the builder to its defaults. | |
| Public Member Functions inherited from guillaume::ecs::EntityBuilder | |
| EntityBuilder (ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry) | |
| Create a builder working on a pair of registries, normally those of one scene. | |
| virtual | ~EntityBuilder (void)=default |
| Virtual destructor. | |
Additional Inherited Members | |
| Protected Member Functions inherited from guillaume::ecs::EntityBuilder | |
| ComponentRegistry & | getComponentRegistry (void) |
| Get the registry in which the builder creates components. | |
| EntityRegistry & | getEntityRegistry (void) |
| Get the registry in which the builder registers the entities it creates. | |
Configures Text widgets and registers them in the scene's entity registry.
| guillaume::entities::Text::Builder::Builder | ( | ecs::ComponentRegistry & | componentRegistry, |
| ecs::EntityRegistry & | entityRegistry ) |
|
overridevirtual |
Build a text from the current configuration, without registering it or giving it a parent.
Implements guillaume::entities::EntityBuilderBase< Text >.
Definition at line 40 of file text.cpp.


| std::shared_ptr< Text > guillaume::entities::Text::Builder::makeText | ( | std::shared_ptr< Entity > | parent, |
| const std::string & | content, | ||
| const float & | fontSize, | ||
| const utility::graphic::Color32Bit & | color ) |
Build a text with an explicit font size, register it under parent and reset the builder.
The role is the one configured on the builder (BodyMedium unless withTypeRole() was called): it gives the weight, line height and letter spacing.
| parent | The entity the text is attached to, or nullptr for a root entity. |
| content | The characters to draw. |
| fontSize | The font size, in dp. |
| color | The text color (RGBA). |
Definition at line 81 of file text.cpp.


| std::shared_ptr< Text > guillaume::entities::Text::Builder::makeText | ( | std::shared_ptr< Entity > | parent, |
| const std::string & | content, | ||
| theme::TypeRole | role, | ||
| const utility::graphic::Color32Bit & | color ) |
Build a text styled by a typescale role, register it under parent and reset the builder.
| parent | The entity the text is attached to, or nullptr for a root entity. |
| content | The characters to draw. |
| role | The typescale role giving the font size, weight, line height and letter spacing. |
| color | The text color (RGBA). |
Definition at line 91 of file text.cpp.

|
overridevirtual |
Restore the defaults: empty content, role BodyMedium, no explicit font size, and the OnSurface color of the active theme.
Implements guillaume::ecs::EntityBuilder.
Definition at line 47 of file text.cpp.


| Text::Builder & guillaume::entities::Text::Builder::withColor | ( | const utility::graphic::Color32Bit & | color | ) |
Set the text color.
| color | The color (RGBA). By default the OnSurface color the active theme had when the builder was last reset. |
Definition at line 75 of file text.cpp.


| Text::Builder & guillaume::entities::Text::Builder::withContent | ( | const std::string & | content | ) |
| Text::Builder & guillaume::entities::Text::Builder::withFontSize | ( | const float & | fontSize | ) |
Override the role font size with an explicit size.
The other metrics still come from the role. A later call to withTypeRole() drops this size.
| fontSize | The font size, in dp. By default the role size is used. |
Definition at line 61 of file text.cpp.


| Text::Builder & guillaume::entities::Text::Builder::withTypeRole | ( | theme::TypeRole | role | ) |
Set the typescale role and drop any explicit font size.
| role | The typescale role, resolved against the active theme each frame. BodyMedium by default. |
Definition at line 67 of file text.cpp.

