summaryrefslogtreecommitdiff
path: root/src/interface/Label.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-01-14 18:51:24 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-01-14 18:51:24 (GMT)
commit2c9295007a287dc01ff63fcf7b3da141f7474e37 (patch)
treee8065e920ca45686a40e41fd46513e13d46f47b0 /src/interface/Label.cpp
parentfc2f52099c0bbb2412046252bf7b5e4113bbe8e4 (diff)
downloadpowder-2c9295007a287dc01ff63fcf7b3da141f7474e37.zip
powder-2c9295007a287dc01ff63fcf7b3da141f7474e37.tar.gz
Various things, also IEF UI
Diffstat (limited to 'src/interface/Label.cpp')
-rw-r--r--src/interface/Label.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/interface/Label.cpp b/src/interface/Label.cpp
new file mode 100644
index 0000000..3a5ea85
--- /dev/null
+++ b/src/interface/Label.cpp
@@ -0,0 +1,38 @@
+#include <string>
+#include "interface/Point.h"
+#include "interface/Label.h"
+
+using namespace ui;
+
+Label::Label(State* 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 = ui::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);
+}