Open Source Tomb Raider Engine
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

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. }