BattleOverlayLogVisualizer.cpp 932 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * BattleOverlayLogVisualizer.cpp, 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. #include "StdInc.h"
  11. #include "BattleOverlayLogVisualizer.h"
  12. #include "BattleInterface.h"
  13. #include "BattleFieldController.h"
  14. #include "../render/Canvas.h"
  15. #include "../render/Colors.h"
  16. #include "../render/EFont.h"
  17. #include "../gui/TextAlignment.h"
  18. BattleOverlayLogVisualizer::BattleOverlayLogVisualizer(
  19. BattleRenderer::RendererRef & target,
  20. BattleInterface & owner)
  21. : target(target), owner(owner)
  22. {
  23. }
  24. void BattleOverlayLogVisualizer::drawText(BattleHex hex, std::vector<std::string> texts)
  25. {
  26. const Point offset = owner.fieldController->hexPositionLocal(hex).topLeft() + Point(20, 20);
  27. target.drawText(offset, EFonts::FONT_TINY, Colors::RED, ETextAlignment::TOPCENTER, texts);
  28. }