-
Notifications
You must be signed in to change notification settings - Fork 5
/
WorldTitleData.cpp
43 lines (36 loc) · 951 Bytes
/
WorldTitleData.cpp
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
#include "master.h"
#include "WorldTitleData.h"
#include "world.h"
using namespace pyrodactyl;
void WorldTitleData::SetLevelTitle()
{
WorldTitle(title.text, subtitle.text, fade);
}
void WorldTitleData::Load(rapidxml::xml_node<char> *node, pyroRect *parent, const bool &echo)
{
ImageData::Load(node, parent, echo);
if (NodeValid("title", node))
{
rapidxml::xml_node<char> *tinode = node->first_node("title");
title.Load(tinode, this);
LoadStr(title.text, "text", tinode, false);
}
if (NodeValid("subtitle", node))
{
rapidxml::xml_node<char> *subnode = node->first_node("subtitle");
subtitle.Load(subnode, this);
LoadStr(subtitle.text, "text", subnode, false);
}
}
void WorldTitleData::Draw()
{
ImageData::FadeDraw(fade);
title.Draw(title.text, title.col, true, fade);
subtitle.Draw(subtitle.text, subtitle.col, true, fade);
}
void WorldTitleData::SetUI()
{
ImageData::SetUI();
title.SetUI(this);
subtitle.SetUI(this);
}