diff --git a/libs/ui/include/psemek/ui/style.hpp b/libs/ui/include/psemek/ui/style.hpp index b04c5582..47382602 100644 --- a/libs/ui/include/psemek/ui/style.hpp +++ b/libs/ui/include/psemek/ui/style.hpp @@ -22,8 +22,9 @@ namespace psemek::ui int inner_margin = 5; int outer_margin = 10; - gfx::color_rgba text_color{0, 0, 0, 255}; + gfx::color_rgba text_color{255, 255, 255, 255}; int text_scale = 1; + geom::vector text_shadow_offset{1, 1}; std::shared_ptr font; }; diff --git a/libs/ui/source/label.cpp b/libs/ui/source/label.cpp index 0fd1cd95..b4a60bb5 100644 --- a/libs/ui/source/label.cpp +++ b/libs/ui/source/label.cpp @@ -60,6 +60,10 @@ namespace psemek::ui auto st = style(); if (!st) return; + if (st->text_shadow_offset != geom::vector{0, 0}) + for (auto & g : cached_state_->glyphs) + p.draw_glyph(*(cached_state_->font), g.character, g.position + geom::cast(st->text_shadow_offset), st->shadow_color); + for (auto & g : cached_state_->glyphs) p.draw_glyph(*(cached_state_->font), g.character, g.position, st->text_color); }