CMessage.h 1.2 KB

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