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

#include "client/imdraw_ext.hh"

#include "client/globals.hh"

void 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());
}