CMessage.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. /// Draw simple dialog box (borders and background only)
  20. static SDL_Surface * drawDialogBox(int w, int h, PlayerColor playerColor = PlayerColor(1));
  21. public:
  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. static void drawIWindow(CInfoWindow * ret, std::string text, PlayerColor player);
  25. /// split text in lines
  26. static std::vector<std::string> breakText(std::string text, size_t maxLineWidth, EFonts font);
  27. /// constructor
  28. static void init();
  29. /// destructor
  30. static void dispose();
  31. };