X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fbattle%2Fstates%2FRunState.cpp;h=7fdc0665c82b6bd09bc64fa2c31d033ae728ad8c;hb=923422e6a71f57b8fa24b826d1e2914faa144081;hp=08c45e80cd8fb97f1a35f9cbc88783204da4a4a8;hpb=6d080d21d8055df9962296863b4c0954bc81410b;p=l2e.git diff --git a/src/battle/states/RunState.cpp b/src/battle/states/RunState.cpp index 08c45e8..7fdc066 100644 --- a/src/battle/states/RunState.cpp +++ b/src/battle/states/RunState.cpp @@ -12,6 +12,10 @@ #include "../../app/Input.h" #include "../../geometry/operators.h" #include "../../geometry/Point.h" +#include "../../graphics/Font.h" +#include "../../graphics/Frame.h" + +#include using app::Application; using app::Input; @@ -61,6 +65,17 @@ void RunState::Render(SDL_Surface *screen) { battle->RenderMonsters(screen, offset); battle->RenderHeroes(screen, offset); // render small tags + RenderTitleBar(screen, offset); +} + +void RunState::RenderTitleBar(SDL_Surface *screen, const Vector &offset) { + int height(battle->Res().titleFrame->BorderHeight() * 2 + battle->Res().titleFont->CharHeight()); + battle->Res().titleFrame->Draw(screen, Point(offset.X(), offset.Y()), battle->BackgroundWidth(), height); + + Point textPosition( + (battle->BackgroundWidth() - (std::strlen(battle->Res().escapeText) * battle->Res().titleFont->CharWidth())) / 2, + battle->Res().titleFrame->BorderHeight()); + battle->Res().titleFont->DrawString(battle->Res().escapeText, screen, textPosition + offset); } }