button, text is placed in middle of button, plane is placed behind text
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user