|
Capycore Engine
0.1.0
A simple and lightweight game engine written in C++ based on the Unity API architecture.
|
#include <text.h>
Public Member Functions | |
| Text (std::string text, std::string font, std::string font_path, int font_size, Color color) | |
| void | update (float dt) override |
| const std::string & | text () const |
| Text & | text (const std::string &text) |
| const std::string & | font () const |
| Text & | font (const std::string &font) |
| const std::string & | font_path () const |
| Text & | font_path (const std::string &font_path) |
| int | font_size () const |
| Text & | font_size (int font_size) |
| Color | color () const |
| Text & | color (Color color) |
| bool | dirty () const |
| void | mark_dirty (bool dirty=true) |
| std::string | type_name () const override |
| Provides a consistent type name for the component. | |
| TextAlignment | alignment () const |
| Text & | alignment (TextAlignment alignment) |
| Point | offset () const |
| Text & | offset (Point offset) |
Public Member Functions inherited from Renderable | |
| Renderable () | |
| Renderable (int layer) | |
| ~Renderable () override=default | |
| Renderable & | order_in_layer (int layer) |
| int | order_in_layer () const |
| void | set_render_strategy (Component &component) |
| virtual IRenderingStrategy & | render_strategy () const |
| Renderable & | disable_draw () noexcept |
| Renderable & | enable_draw () noexcept |
| bool | should_draw () const noexcept |
Public Member Functions inherited from Component | |
| Component () | |
| virtual | ~Component ()=default |
| bool | active () const noexcept |
| Checks if the component is active. | |
| Component & | active (bool value) noexcept |
| bool | marked_for_deletion () const noexcept |
| Activates the component. | |
| Component & | mark_for_deletion () noexcept |
| virtual void | on_attach () |
| Called when the component is attached to a GameObject. | |
| virtual void | on_detach () |
| Called when the component is detached from a GameObject. | |
| virtual void | on_serialize (std::vector< uint8_t > &) const |
| Serializes the component's state into a byte array. | |
| virtual void | on_deserialize (const std::vector< uint8_t > &, size_t &) |
| Deserializes the component's state from a byte array. | |
| const std::optional< std::reference_wrapper< GameObject > > & | parent () const noexcept |
| Gets the parent GameObject of this component. | |
| std::optional< std::reference_wrapper< GameObject > > & | parent () noexcept |
| Gets the parent GameObject of this component. | |
| Component & | parent (GameObject &parent) |
| Component & | parent (std::nullopt_t nullopt) |
| size_t | add_on_attach (const std::function< void(Component &)> &action) |
| Retrieves the type information of the component. | |
| void | remove_on_attach (size_t index) |
| size_t | add_on_detach (const std::function< void(Component &)> &action) |
| Adds an action to be performed when the component is attached. | |
| void | remove_on_detach (size_t index) |
Additional Inherited Members | |
Protected Attributes inherited from Renderable | |
| std::unique_ptr< IRenderingStrategy > | render_strategy_ |
| int | ordering_layer_ = 0 |
| bool | draw {true} |
Represents a text element in the UI with customizable font, size, color, and content. Inherits from Renderable to allow rendering strategies.
Usage:
| Text::Text | ( | std::string | text, |
| std::string | font, | ||
| std::string | font_path, | ||
| int | font_size, | ||
| Color | color | ||
| ) |
| TextAlignment Text::alignment | ( | ) | const |
| Text & Text::alignment | ( | TextAlignment | alignment | ) |
| Color Text::color | ( | ) | const |
| bool Text::dirty | ( | ) | const |
| const std::string & Text::font | ( | ) | const |
| Text & Text::font | ( | const std::string & | font | ) |
| const std::string & Text::font_path | ( | ) | const |
| Text & Text::font_path | ( | const std::string & | font_path | ) |
| int Text::font_size | ( | ) | const |
| Text & Text::font_size | ( | int | font_size | ) |
| void Text::mark_dirty | ( | bool | dirty = true | ) |
| Point Text::offset | ( | ) | const |
| const std::string & Text::text | ( | ) | const |
| Text & Text::text | ( | const std::string & | text | ) |
|
overridevirtual |
Provides a consistent type name for the component.
Reimplemented from Renderable.
|
inlineoverridevirtual |
Implements Component.