diff options
Diffstat (limited to 'src/interface/Label.cpp')
| -rw-r--r-- | src/interface/Label.cpp | 38 |
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); +} |
