Capycore Engine  0.1.0
A simple and lightweight game engine written in C++ based on the Unity API architecture.
Loading...
Searching...
No Matches
ui_text.h
Go to the documentation of this file.
1#pragma once
2
5
24class UIText : public UIObject {
25 public:
26 UIText(Scene& scene, std::string text, std::string font,
27 std::string font_path, float width, float height, Point pivot,
29
30 void update(float dt) override;
31
32 [[nodiscard]] const std::string& text() const;
33 UIText& text(const std::string& text);
34
35 [[nodiscard]] const std::string& font() const;
36 UIText& font(const std::string& font);
37
38 [[nodiscard]] const std::string& font_path() const;
39 UIText& font_path(const std::string& font_path);
40
41 [[nodiscard]] int font_size() const;
43
44 [[nodiscard]] Color color() const;
46
47 private:
48 std::string text_;
49 std::string font_;
50 std::string font_path_;
51 int font_size_;
52 Color color_;
53};
Represents a color with red, green, blue, and alpha components. Each component is represented as an u...
Definition color.h:7
std::optional< std::reference_wrapper< T > > get_component() const noexcept
Get the first component of type T attached to this GameObject.
Definition gameObject.h:141
Scene & scene() const noexcept
Represents a point in 2D space.
Definition point.h:6
Represents a scene within the engine. A scene contains multiple GameObjects and manages their lifecyc...
Definition scene.h:19
Base class for all UI objects.
Definition ui_object.h:16
Point pivot() const
float height() const
Point anchor() const
float width() const
A UI text element.
Definition ui_text.h:24
UIText & color(Color color)
UIText(Scene &scene, std::string text, std::string font, std::string font_path, float width, float height, Point pivot, Point anchor)
UIText & font_path(const std::string &font_path)
UIText & text(const std::string &text)
const std::string & font() const
UIText & font_size(int font_size)
const std::string & text() const
UIText & font(const std::string &font)
const std::string & font_path() const
int font_size() const
void update(float dt) override
Update the UI object.
Color color() const