Text.cpp 404 B

1234567891011121314151617181920212223242526272829
  1. #include "Text.h"
  2. Text::Text(const std::string &text, Vec2f position) : MenuElement(position)
  3. {
  4. this->text = text;
  5. color = Vec3f(50, 150, 150);
  6. }
  7. Text::~Text()
  8. {
  9. }
  10. void Text::draw()
  11. {
  12. glColor4f(color.x, color.y, color.z, 1.0f);
  13. Util::glutBitmapString(text, position.x, position.y);
  14. }
  15. void Text::update(int x, int y)
  16. {
  17. //Do nothing
  18. }
  19. void Text::setColor(Vec3f color)
  20. {
  21. this->color = color;
  22. }