-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtext_2d.cpp
More file actions
47 lines (35 loc) · 1.08 KB
/
text_2d.cpp
File metadata and controls
47 lines (35 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "./text_2d.hpp"
#include "things/thing_data.hpp"
using namespace TheatreFile;
void Text2D::SetVariables(Farg<ThingData> data)
{
Super::SetVariables(data);
data.get_variable(mDebugSolid, "Solid");
data.get_variable(mDebugOutline, "Outline");
data.get_variable(mFontID, "Font");
data.get_variable(mText, "Text");
if(glm::vec3 color{}; data.get_variable(color, "Color") == OK)
{ mColor = color; }
}
Shared<ThingData> Text2D::GetVariables() const
{
auto data{Super::GetVariables()};
data->set_variable(mDebugSolid, "Solid");
data->set_variable(mDebugOutline, "Outline");
data->set_variable(mFontID, "Font");
data->set_variable(mText, "Text", true);
data->set_variable(mColor.glm(), "Color");
return data;
}
Sarg Text2D::Text() const
{ return mText; }
void Text2D::SetText(Sarg inText)
{ mText = inText; }
ID Text2D::Font() const
{ return mFontID; }
void Text2D::SetFont(ID inFontID)
{ mFontID = inFontID; }
Farg<ColorRGB> Text2D::Color() const
{ return mColor; }
void Text2D::SetColor(Farg<ColorRGB> inColor)
{ mColor = inColor; }