cangine
Loading...
Searching...
No Matches
label_object.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
5#include "../game_object.hpp"
6
7#include "../../components/textrenderer_component.hpp"
8#include "../../../types/vector2.hpp"
9#include "../../../types/vector3.hpp"
10
16namespace cangine {
23 class Label : public GameObject {
24 private:
26 public:
32 Label(std::string text = "Label",
33 Vector3 position = Vector3(0, 0, 80));
34
39 std::string getText();
49 int getFontHeight();
50
55 void setText(std::string text);
60 void setFontHeight(int heightIn);
71
77 };
78}
Base class for everything that lives in the scene.
Definition game_object.hpp:20
T * getComponent()
Returns the first attached component of a type.
Definition game_object.hpp:93
Convenience game object that displays a line of text.
Definition label_object.hpp:23
void setBackgroundColor(Color colorIn)
Sets the background color behind the text.
Definition label_object.cpp:34
void setFontHeight(int heightIn)
Sets the font pixel height.
Definition label_object.cpp:26
void setText(std::string text)
Sets the displayed text.
Definition label_object.cpp:22
Vector2 getSize()
Returns the rendered size of the text.
Definition label_object.cpp:14
void setColor(Color colorIn)
Sets the text color.
Definition label_object.cpp:30
TextRendererComponent * trc
The underlying text renderer component.
Definition label_object.hpp:25
std::string getText()
Returns the current text.
Definition label_object.cpp:10
TextRendererComponent * getTextRendererComponent()
Returns the underlying text renderer component.
Definition label_object.cpp:38
int getFontHeight()
Returns the font pixel height.
Definition label_object.cpp:18
Component that renders a text string, optionally over a background.
Definition textrenderer_component.hpp:18
Definition audiomanager.cpp:4
RGBA color stored as normalized floating-point components.
Definition color.hpp:12
Two-component floating-point vector.
Definition vector2.hpp:13
Three-component floating-point vector.
Definition vector3.hpp:13