27#include <utility/graphic/color.hpp>
29#include "guillaume/ecs/component_registry.hpp"
30#include "guillaume/entities/builder_base.hpp"
31#include "guillaume/ecs/entity_builder.hpp"
32#include "guillaume/ecs/entity_filler.hpp"
34#include "guillaume/components/accessibility.hpp"
35#include "guillaume/components/glyph.hpp"
36#include "guillaume/components/bound.hpp"
37#include "guillaume/components/transform.hpp"
38#include "guillaume/components/color.hpp"
79 components::Glyph, components::Color>
89 std::string _glyphName;
91 utility::graphic::Color32Bit _color;
118 void reset(
void)
override;
165 std::shared_ptr<Icon>
166 makeIcon(std::shared_ptr<Entity> parent,
167 const std::string &iconName,
const float &fontSize,
168 const utility::graphic::Color32Bit &color,
184 template<
typename... Arguments>
185 static std::shared_ptr<Icon>
create(Arguments &&...arguments)
187 std::shared_ptr<Icon> entity(
188 new Icon(std::forward<Arguments>(arguments)...));
220 Icon &
setColor(
const utility::graphic::Color32Bit &color);
254 const float &fontSize,
const utility::graphic::Color32Bit &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...
The base class of a widget without children: an Entity that creates its components when it is constru...
Owns entities and gives the systems the list of entities to visit.
EntityBuilderBase(ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry)
Builder(ecs::ComponentRegistry &componentRegistry, ecs::EntityRegistry &entityRegistry)
Construct a builder holding the defaults of reset().
Builder & withGlyphName(const std::string &glyphName)
Choose the icon to draw.
Builder & withFontSize(float fontSize)
Set the size of the icon.
Builder & withColor(const utility::graphic::Color32Bit &color)
Set the icon color.
Builder & withStyle(const components::Glyph::Style &style)
Set the Material Symbols style of the glyph.
void reset(void) override
Restore the defaults: empty glyph name, font size 24, the OnSurface color of the active theme,...
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.
std::shared_ptr< Icon > buildEntity(void) override
Build an icon from the current configuration, without registering it or giving it a parent.
A Material Symbols icon, chosen by name and drawn as one glyph of the icon font.
Icon & setAccessibilityLabel(const std::string &label)
Give the icon a meaning for assistive technologies.
Icon & setFontSize(const float &fontSize)
Set the size of the icon.
Icon & setStyle(const components::Glyph::Style &style)
Set the Material Symbols style of the glyph.
Icon & setGlyphName(const std::string &glyphName)
Change the icon to draw.
Icon & setColor(const utility::graphic::Color32Bit &color)
Set the icon color.
static std::shared_ptr< Icon > create(Arguments &&...arguments)
Build an icon without registering it in an entity registry.
Widgets: the classes used to create entities with the right components and children.