diff options
author | BlockMen <nmuelll@web.de> | 2013-12-12 21:02:09 +0100 |
---|---|---|
committer | PilzAdam <pilzadam@minetest.net> | 2013-12-14 21:11:38 +0100 |
commit | 977232261388fa80bd6ab3bb849ae4d7a8ade73e (patch) | |
tree | b857e64f9181ef2f713fce992e3aaf04e9577284 /src/cguittfont/CGUITTFont.cpp | |
parent | 7a4c1e7327a19820ec1e943d031c0e6e057e0156 (diff) | |
download | minetest-977232261388fa80bd6ab3bb849ae4d7a8ade73e.tar.gz minetest-977232261388fa80bd6ab3bb849ae4d7a8ade73e.tar.bz2 minetest-977232261388fa80bd6ab3bb849ae4d7a8ade73e.zip |
Add alpha setting to font shadow
Diffstat (limited to 'src/cguittfont/CGUITTFont.cpp')
-rw-r--r-- | src/cguittfont/CGUITTFont.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cguittfont/CGUITTFont.cpp b/src/cguittfont/CGUITTFont.cpp index b9c979090..9a702cad7 100644 --- a/src/cguittfont/CGUITTFont.cpp +++ b/src/cguittfont/CGUITTFont.cpp @@ -199,7 +199,7 @@ void SGUITTGlyph::unload() ////////////////////// -CGUITTFont* CGUITTFont::createTTFont(IGUIEnvironment *env, const io::path& filename, const u32 size, const bool antialias, const bool transparency, const u32 shadow) +CGUITTFont* CGUITTFont::createTTFont(IGUIEnvironment *env, const io::path& filename, const u32 size, const bool antialias, const bool transparency, const u32 shadow, const u32 shadow_alpha) { if (!c_libraryLoaded) { @@ -217,6 +217,7 @@ CGUITTFont* CGUITTFont::createTTFont(IGUIEnvironment *env, const io::path& filen } font->shadow_offset = shadow; + font->shadow_alpha = shadow_alpha; return font; } @@ -631,7 +632,7 @@ void CGUITTFont::draw(const core::stringw& text, const core::rect<s32>& position if (shadow_offset) { for (size_t i = 0; i < page->render_positions.size(); ++i) page->render_positions[i] += core::vector2di(shadow_offset, shadow_offset); - Driver->draw2DImageBatch(page->texture, page->render_positions, page->render_source_rects, clip, video::SColor(255, 0, 0, 0), true); + Driver->draw2DImageBatch(page->texture, page->render_positions, page->render_source_rects, clip, video::SColor(shadow_alpha,0,0,0), true); for (size_t i = 0; i < page->render_positions.size(); ++i) page->render_positions[i] -= core::vector2di(shadow_offset, shadow_offset); } |