Struct Engine::Text¶
Component representing 2D renderable text in the ECS. More...
#include <Text.hpp>
Public Attributes¶
| Type | Name |
|---|---|
| Color | color = WHITETint color of the text. |
| Font | font = {}Raylib Font asset used for rendering (default font if texture.id == 0). |
| std::string | fontPath = ""Path to custom font file (relative to project). |
| float | fontsize = 10.0fFont size in pixels. |
| float | spacing = 1.0fSpacing between characters. |
| std::string | text = ""Content string to display. |
Public Functions¶
| Type | Name |
|---|---|
| Text (std::string Text="", float Fontsize=10.0f, Color tint=WHITE, std::string FontPath="") Constructs a Text component with default font. |
|
| Text (Font font, std::string Text, float Fontsize, float Spacing, Color tint, std::string FontPath="") Constructs a Text component with a custom font and character spacing. |
Detailed Description¶
Holds string content, font reference, font size, character spacing, and tint color. Rendered by TextSystem at the entity's Position.
Public Attributes Documentation¶
variable color¶
Tint color of the text.
variable font¶
Raylib Font asset used for rendering (default font if texture.id == 0).
variable fontPath¶
Path to custom font file (relative to project).
variable fontsize¶
Font size in pixels.
variable spacing¶
Spacing between characters.
variable text¶
Content string to display.
Public Functions Documentation¶
function Text [½]¶
Constructs a Text component with default font.
inline Engine::Text::Text (
std::string Text="",
float Fontsize=10.0f,
Color tint=WHITE,
std::string FontPath=""
)
Parameters:
- Text The text string to be displayed.
FontsizeThe size of the text in pixels.tintThe color tint for rendering.FontPathOptional path to custom font file.
function Text [2/2]¶
Constructs a Text component with a custom font and character spacing.
inline Engine::Text::Text (
Font font,
std::string Text,
float Fontsize,
float Spacing,
Color tint,
std::string FontPath=""
)
Parameters:
fontThe Raylib Font asset to use.- Text The text string to be displayed.
FontsizeThe size of the text in pixels.SpacingThe space between characters in pixels.tintThe color tint for rendering.FontPathOptional path to custom font file.
The documentation for this class was generated from the following file /home/runner/work/r-type/r-type/Engine/include/Components/Text.hpp