You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
802 B

#include "textlabel.h"
namespace segl {
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;
}
void GLGuiTextLabel::setColor(Color c) {
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();
}
} // namespace segl