25#include "component.hpp"
26#include "primitives/text.hpp"
73 const std::string &
getText(
void)
const {
return _text; }
90 std::shared_ptr<Component>
render(
void)
override {
100 auto textPrimitive = std::make_shared<Text>(_text,
Point(0, 0, 0));
103 return shared_from_this();
Base class for all UI components.
std::vector< std::shared_ptr< Primitive > > _primitives
Vector of primitives for rendering.
State _state
The component's state.
Represents a UI event with type, target, and optional data.
Simple display component for text.
Label(const std::string &text, const Properties &properties)
Constructs a Label object with properties.
~Label(void) override=default
Destroys the Label object.
void setText(const std::string &text)
Sets the label's text.
std::shared_ptr< Component > render(void) override
Renders the label.
Label(const std::string &text)
Constructs a Label object.
void onEvent(const Event &event) override
Handles events for the label.
const std::string & getText(void) const
Gets the label's text.
Represents a point in 3D space.
Manages immutable component properties.
const std::map< std::string, std::any > & getData(void) const
Get the entire state data map.
void set(const std::string &key, const T &value)
Set a state value by key.
T get(const std::string &key) const
Get a state value by key with type casting.