diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-01-29 14:44:36 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-01-29 14:44:36 (GMT) |
| commit | 680a36549adaed0c3ce7e8906fadbdf190b0b3b0 (patch) | |
| tree | 21ca16411c1687bb212369a59c5f3de2a0cf023b /src/interface | |
| parent | 7c53ca7799832920066c23cfad2f1d7fa82233c7 (diff) | |
| download | powder-680a36549adaed0c3ce7e8906fadbdf190b0b3b0.zip powder-680a36549adaed0c3ce7e8906fadbdf190b0b3b0.tar.gz | |
Background retrieval of save info and save list.
Diffstat (limited to 'src/interface')
| -rw-r--r-- | src/interface/Label.cpp | 13 | ||||
| -rw-r--r-- | src/interface/Label.h | 9 |
2 files changed, 14 insertions, 8 deletions
diff --git a/src/interface/Label.cpp b/src/interface/Label.cpp index 6fc47e2..e5f99a2 100644 --- a/src/interface/Label.cpp +++ b/src/interface/Label.cpp @@ -6,7 +6,7 @@ using namespace ui; -Label::Label(Window* parent_state, std::string labelText): +/*Label::Label(Window* parent_state, std::string labelText): Component(parent_state), text(labelText), textPosition(ui::Point(0, 0)), @@ -14,19 +14,20 @@ Label::Label(Window* parent_state, std::string labelText): textHAlign(AlignCentre) { TextPosition(); -} +}*/ Label::Label(Point position, Point size, std::string labelText): Component(position, size), text(labelText), textPosition(ui::Point(0, 0)), textVAlign(AlignMiddle), - textHAlign(AlignCentre) + textHAlign(AlignCentre), + textColour(255, 255, 255) { TextPosition(); } -Label::Label(std::string labelText): +/*Label::Label(std::string labelText): Component(), text(labelText), textPosition(ui::Point(0, 0)), @@ -34,7 +35,7 @@ Label::Label(std::string labelText): textHAlign(AlignCentre) { TextPosition(); -} +}*/ Label::~Label() { @@ -80,6 +81,6 @@ void Label::SetText(std::string text) void Label::Draw(const Point& screenPos) { Graphics * g = Engine::Ref().g; - g->drawtext(screenPos.X+textPosition.X, screenPos.Y+textPosition.Y, text, 255, 255, 255, 255); + g->drawtext(screenPos.X+textPosition.X, screenPos.Y+textPosition.Y, text, textColour.Red, textColour.Green, textColour.Blue, 255); } diff --git a/src/interface/Label.h b/src/interface/Label.h index 9b5a454..b925140 100644 --- a/src/interface/Label.h +++ b/src/interface/Label.h @@ -5,6 +5,7 @@ #include "Component.h" #include "Misc.h" +#include "Colour.h" namespace ui { @@ -14,10 +15,12 @@ namespace ui ui::Point textPosition; HorizontalAlignment textHAlign; VerticalAlignment textVAlign; + + Colour textColour; public: - Label(Window* parent_state, std::string labelText); + //Label(Window* parent_state, std::string labelText); Label(Point position, Point size, std::string labelText); - Label(std::string labelText); + //Label(std::string labelText); virtual ~Label(); void TextPosition(); @@ -26,6 +29,8 @@ namespace ui VerticalAlignment GetVAlignment() { return textVAlign; } void SetAlignment(HorizontalAlignment hAlign, VerticalAlignment vAlign) { textHAlign = hAlign; textVAlign = vAlign; TextPosition(); } + void SetTextColour(Colour textColour) { this->textColour = textColour; } + virtual void Draw(const Point& screenPos); }; |
