CMessage.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. #include "gui/Geometries.h"
  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. };