1make_trans_font(3) Allegro manual make_trans_font(3)
2
3
4
6 make_trans_font - Makes a font use transparency. Allegro game programā
7 ming library.
8
10 #include <allegro.h>
11
12
13 void make_trans_font(FONT *f);
14
16 This function converts a font to use transparency for drawing. That is,
17 each glyph in the font will be drawn with draw_trans_sprite, so you can
18 use the same blenders as with draw_trans_sprite to draw the font. One
19 common use of this is to load a bitmap font with an alpha channel, and
20 therefore get anti-aliased text output by using Allegro's alpha
21 blender. Here's an example how to do that:
22
23
24 FONT *f = load_font("alphafont.tga", NULL, NULL);
25 make_trans_font(f);
26 set_alpha_blender();
27 textprintf_centre_ex(screen, f, 320, 240, -1, -1, "Anti-aliased Font!");
28
29
31 is_trans_font(3), set_alpha_blender(3), load_font(3),
32 draw_trans_sprite(3)
33
34
35
36Allegro version 4.4.3 make_trans_font(3)