button, text is placed in middle of button, plane is placed behind text

This commit is contained in:
Remco
2016-06-20 12:38:16 +02:00
parent 6cf9437620
commit 8dcee70324
7 changed files with 53 additions and 26 deletions
+4 -2
View File
@@ -5,6 +5,8 @@ Text::Text(const std::string &text, Vec2f position) : MenuElement(position)
{
this->text = text;
color = Vec3f(50, 150, 150);
textHeight = 14;
textWidth = Util::glutTextWidth(text);
}
@@ -14,8 +16,8 @@ Text::~Text()
void Text::draw()
{
glColor4f(color.x, color.y, color.z, 1.0f);
Util::glutBitmapString(text, position.x, position.y);
glColor4f(color.x/255.0f, color.y/255.0f, color.z/255.0f, 1.0f);
Util::glutBitmapString(text, position.x-1, position.y+textHeight);
}
void Text::update(int x, int y)