Open Source Tomb Raider Engine
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.

Font.cpp 517B

12345678910111213141516171819202122232425
  1. /*!
  2. * \file src/Font.cpp
  3. * \brief Font implementation
  4. *
  5. * \author xythobuz
  6. */
  7. #include "global.h"
  8. #include "utils/strings.h"
  9. #include "Window.h"
  10. #include "Font.h"
  11. Font::~Font() {
  12. }
  13. void Font::setFont(std::string font) {
  14. assert(mFontInit == false);
  15. mFontName = font;
  16. }
  17. void Font::drawTextCentered(unsigned int x, unsigned int y, float scale,
  18. const unsigned char color[4], unsigned int width, std::string s) {
  19. drawText(x + ((width / 2) - (widthText(scale, s) / 2)), y, scale, color, s);
  20. }