Re: [AD] translucent fonts |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Thu, 2006-01-05 at 16:51 +0100, Elias Pschernig wrote:
>
> Attached is a patch which does that. Since it was the 3rd location to
> define a bitmap_has_alpha(), the patch makes it an API function. And the
> API toget alpha font drawing is now to use make_trans_font() on a font
> to switch its vtable, and no more state.
Attached would be documentation for the added function. I gather from
the comments so far that I should apply it - and following the datafile
index and config listing cases, to both branches..
--
Elias Pschernig
Index: docs/src/allegro._tx
===================================================================
--- docs/src/allegro._tx (revision 5659)
+++ docs/src/allegro._tx (working copy)
@@ -6954,6 +6954,20 @@
should use this only on fonts you have loaded manually after you are done
with them, to prevent memory leaks in your program.
+@@void @make_trans_font(FONT *f);
+@xref load_datafile_object, load_font, draw_trans_sprite
+@shortdesc Makes a font use transparency.
+ This function converts a font to use transparency for drawing. That is, each
+ glyph in the font will be drawn with draw_trans_sprite, so you can use the
+ same blenders to draw the font.
+
+ Example:
+ <codeblock>
+ FONT *f = load_font("alphafont.tga", NULL, NULL);
+ make_trans_font(f);
+ set_alpha_blender();
+ textprintf_centre_ex(screen, f, 320, 240, -1, -1, "Translucent Font!");<endblock>
+
@@int @is_color_font(FONT *f)
@xref is_mono_font
@shortdesc Returns TRUE if a font is a color font.