The-Powder-Toy/src/interface/Label.h

40 lines
939 B
C
Raw Normal View History

2012-01-14 12:51:24 -06:00
#ifndef LABEL_H
#define LABEL_H
#include <string>
#include "Component.h"
2012-01-20 16:07:49 -06:00
#include "Misc.h"
#include "Colour.h"
2012-01-14 12:51:24 -06:00
namespace ui
{
class Label : public Component
{
2012-01-20 16:07:49 -06:00
std::string text;
ui::Point textPosition;
HorizontalAlignment textHAlign;
VerticalAlignment textVAlign;
Colour textColour;
2012-01-14 12:51:24 -06:00
public:
//Label(Window* parent_state, std::string labelText);
2012-01-14 12:51:24 -06:00
Label(Point position, Point size, std::string labelText);
//Label(std::string labelText);
2012-01-14 12:51:24 -06:00
virtual ~Label();
2012-01-20 16:07:49 -06:00
void TextPosition();
void SetText(std::string text);
HorizontalAlignment GetHAlignment() { return textHAlign; }
VerticalAlignment GetVAlignment() { return textVAlign; }
void SetAlignment(HorizontalAlignment hAlign, VerticalAlignment vAlign) { textHAlign = hAlign; textVAlign = vAlign; TextPosition(); }
void SetTextColour(Colour textColour) { this->textColour = textColour; }
2012-01-14 12:51:24 -06:00
virtual void Draw(const Point& screenPos);
};
}
#endif // LABEL_H