-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathCaption.cpp
More file actions
34 lines (30 loc) · 710 Bytes
/
Copy pathCaption.cpp
File metadata and controls
34 lines (30 loc) · 710 Bytes
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
#include "master.h"
#include "Caption.h"
using namespace pyrodactyl;
void Caption::Load(rapidxml::xml_node<char> *node, pyroRect *parent)
{
if (TextData::Load(node, parent, false))
{
LoadStr(text, "text", node);
LoadNum(col_h, "color_h", node, false);
LoadNum(col_s, "color_s", node, false);
enabled = true;
}
}
void Caption::Init(const Caption &e, pyroRect *parent, const float &XOffset, const float &YOffset)
{
*this = e;
Element::Init(e, parent, XOffset, YOffset);
}
void Caption::Draw(const CaptionState &state)
{
if (enabled)
{
if (state == CAP_SELECT)
TextData::Draw(text, col_s);
else if (state == CAP_HOVER)
TextData::Draw(text, col_h);
else
TextData::Draw(text);
}
}