28#include <utility/graphic/color.hpp>
30#include "guillaume/ecs/component_registry.hpp"
31#include "guillaume/ecs/entity.hpp"
32#include "guillaume/ecs/entity_registry.hpp"
34#include "guillaume/components/glyph.hpp"
36#include "guillaume/entities/icon.hpp"
37#include "guillaume/entities/text.hpp"
62 std::shared_ptr<ecs::Entity> parent,
const std::string &glyphName,
63 float fontSize,
const utility::graphic::Color32Bit &color,
66 if (glyphName.empty() || parent ==
nullptr) {
72 return builder.
makeIcon(parent, glyphName, fontSize, color, style);
91 std::shared_ptr<ecs::Entity> parent,
const std::string &content,
92 float fontSize,
const utility::graphic::Color32Bit &color)
94 if (content.empty() || parent ==
nullptr) {
100 return builder.
makeText(parent, content, fontSize, color);
120 std::shared_ptr<ecs::Entity> parent,
const std::string &content,
123 if (content.empty() || parent ==
nullptr) {
129 return builder.
makeText(parent, content, role, color);
Style
Family of the Material Symbols font the icon belongs to.
Stores every component of a scene, per component type and per entity identifier, and knows which ones...
Owns entities and gives the systems the list of entities to visit.
Configures Icon widgets and registers them in the scene's entity registry.
std::shared_ptr< Icon > makeIcon(std::shared_ptr< Entity > parent, const std::string &iconName, const float &fontSize, const utility::graphic::Color32Bit &color, const components::Glyph::Style &style)
Build an icon, register it under parent and reset the builder.
Configures Text widgets and registers them in the scene's entity registry.
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.
Widgets: the classes used to create entities with the right components and children.
std::shared_ptr< Text > buildText(ecs::ComponentRegistry ®istry, ecs::EntityRegistry &entityRegistry, std::shared_ptr< ecs::Entity > parent, const std::string &content, float fontSize, const utility::graphic::Color32Bit &color)
Create a Text of a given font size as a child of a widget, or nothing when there is no content.
std::shared_ptr< Icon > buildIcon(ecs::ComponentRegistry ®istry, ecs::EntityRegistry &entityRegistry, std::shared_ptr< ecs::Entity > parent, const std::string &glyphName, float fontSize, const utility::graphic::Color32Bit &color, components::Glyph::Style style=components::Glyph::Style::Outlined)
Create an Icon as a child of a widget, or nothing when there is no glyph to show.
TypeRole
The named text styles of Material Design 3: what a piece of text is, not how big it is.