Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Borghetti <bdiego@gmail.com>2009-06-23 20:27:35 +0400
committerDiego Borghetti <bdiego@gmail.com>2009-06-23 20:27:35 +0400
commitcb59bf722e597899c0653777f72bcc85ab476eca (patch)
tree1fc9a3f2ed1b1e7e12356191fe1bc93c228d42a3 /source/blender/blenfont/intern/blf.c
parenteb22a7b2102cceb432e3545cd342956e92873a49 (diff)
Move shadow option (for text) from editor/interface to blenfont.
Two new function: BLF_shadow: set the level (for blur) and the shadow color. BLF_shadow_offset: set the x and y offset for shadow. (this is the current position plus offset) By default shadow is not enable in the font, so before draw the text you need call BLF_enable(BLF_SHADOW), also remember disable the option in the end.
Diffstat (limited to 'source/blender/blenfont/intern/blf.c')
-rw-r--r--source/blender/blenfont/intern/blf.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c
index f06c7fb0d28..9dad5a4bfa0 100644
--- a/source/blender/blenfont/intern/blf.c
+++ b/source/blender/blenfont/intern/blf.c
@@ -500,3 +500,28 @@ void BLF_kerning(float space)
if (font)
font->kerning= space;
}
+
+void BLF_shadow(int level, float r, float g, float b, float a)
+{
+ FontBLF *font;
+
+ font= global_font[global_font_cur];
+ if (font) {
+ font->shadow= level;
+ font->shadow_col[0]= r;
+ font->shadow_col[1]= g;
+ font->shadow_col[2]= b;
+ font->shadow_col[3]= a;
+ }
+}
+
+void BLF_shadow_offset(int x, int y)
+{
+ FontBLF *font;
+
+ font= global_font[global_font_cur];
+ if (font) {
+ font->shadow_x= x;
+ font->shadow_y= y;
+ }
+}