2008-02-09 13:43:23 +01:00
|
|
|
#include "textlabel.h"
|
|
|
|
|
2008-08-10 17:14:54 +02:00
|
|
|
namespace segl {
|
|
|
|
|
2008-02-09 13:43:23 +01:00
|
|
|
GLGuiTextLabel::GLGuiTextLabel(int _x, int _y, bool _center, int _wrap) {
|
|
|
|
setPos(_x, _y);
|
|
|
|
center = _center;
|
|
|
|
wrap = _wrap;
|
|
|
|
col.set(1.0f, 1.0f, 1.0f, 1.0f);
|
|
|
|
}
|
|
|
|
|
|
|
|
GLGuiTextLabel::GLGuiTextLabel(std::string str, int _x, int _y, bool _center, int _wrap) {
|
|
|
|
setPos(_x, _y);
|
|
|
|
center = _center;
|
|
|
|
wrap = _wrap;
|
|
|
|
setText(str);
|
|
|
|
col.set(1.0f, 1.0f, 1.0f, 1.0f);
|
|
|
|
}
|
|
|
|
|
|
|
|
void GLGuiTextLabel::setText(std::string str) {
|
|
|
|
text = str;
|
|
|
|
}
|
|
|
|
|
2008-08-10 17:14:54 +02:00
|
|
|
void GLGuiTextLabel::setColor(Color c) {
|
2008-02-09 13:43:23 +01:00
|
|
|
col = c;
|
|
|
|
}
|
|
|
|
|
|
|
|
void GLGuiTextLabel::setPos(int _x, int _y) {
|
|
|
|
x = _x;
|
|
|
|
y = _y;
|
|
|
|
}
|
|
|
|
|
|
|
|
void GLGuiTextLabel::render() {
|
|
|
|
glColorGLC(col);
|
|
|
|
|
|
|
|
GLFontEngine::prepare2DbyPushingMatrix();
|
|
|
|
fontengine.renderLines(text, x, y, center, 0, wrap, 0);
|
|
|
|
GLFontEngine::regain3DbyPoppingMatrix();
|
|
|
|
}
|
2008-08-10 17:14:54 +02:00
|
|
|
|
|
|
|
} // namespace segl
|
|
|
|
|