summaryrefslogtreecommitdiffstats
path: root/game/client/gui/imdraw_ext.cc
blob: e6db1484dd5686bc2b6b3d4d464e9d1a56704a14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "client/pch.hh"

#include "client/gui/imdraw_ext.hh"

#include "client/globals.hh"

void gui::imdraw_ext::text_shadow(
    const std::string& text, const ImVec2& position, ImU32 text_color, ImU32 shadow_color, ImFont* font, ImDrawList* draw_list)
{
    const auto shadow_position = ImVec2(position.x + 0.5f * globals::gui_scale, position.y + 0.5f * globals::gui_scale);
    draw_list->AddText(font, font->FontSize, shadow_position, shadow_color, text.c_str(), text.c_str() + text.size());
    draw_list->AddText(font, font->FontSize, position, text_color, text.c_str(), text.c_str() + text.size());
}