CMessage.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * CMessage.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include "Graphics.h"
  12. struct SDL_Surface;
  13. class CInfoWindow;
  14. class CComponent;
  15. /// Class which draws formatted text messages and generates chat windows
  16. class CMessage
  17. {
  18. /// Draw simple dialog box (borders and background only)
  19. static SDL_Surface * drawDialogBox(int w, int h, PlayerColor playerColor = PlayerColor(1));
  20. public:
  21. /// Draw border on exiting surface
  22. static void drawBorder(PlayerColor playerColor, SDL_Surface * ret, int w, int h, int x=0, int y=0);
  23. static void drawIWindow(CInfoWindow * ret, std::string text, PlayerColor player);
  24. /// split text in lines
  25. static std::vector<std::string> breakText(std::string text, size_t maxLineWidth, EFonts font);
  26. /// constructor
  27. static void init();
  28. /// destructor
  29. static void dispose();
  30. };