blob: cf09d4e4284ee8135ed5591904468a2ab0f2222e (
plain)
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
|
#include <string>
#include "Config.h"
#include "Global.h"
#include "interface/Point.h"
#include "interface/Label.h"
using namespace ui;
Label::Label(Window* parent_state, std::string labelText):
Component(parent_state),
LabelText(labelText)
{
}
Label::Label(Point position, Point size, std::string labelText):
Component(position, size),
LabelText(labelText)
{
}
Label::Label(std::string labelText):
Component(),
LabelText(labelText)
{
}
Label::~Label()
{
}
void Label::Draw(const Point& screenPos)
{
Graphics * g = Engine::Ref().g;
g->drawtext(Position.X+(Size.X-Graphics::textwidth((char *)LabelText.c_str()))/2, Position.Y+(Size.Y-10)/2, LabelText, 255, 255, 255, 255);
}
|