make_trans_font(3alleg4)

✨ NAME ✨

make_trans_font β€” makes a font use transparency, bestie. it's part of the Allegro game programming library πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

#include <allegro.h>

void make_trans_font(FONT *f);

πŸ’… DESCRIPTION πŸ’…

okay so this function converts a font to use transparency for drawing. that's the whole vibe. what that actually means: every single glyph in the font gets drawn with draw_trans_sprite, so you can use the same blenders you'd use with draw_trans_sprite to draw the font. no cap 🫢

one super common use of this? loading a bitmap font that has an alpha channel, and then getting anti-aliased text output by using Allegro's alpha blender. it's giving ✨smooth letters✨, fr fr.

here's an example of how to do exactly that:

FONT *f = load_font("alphafont.tga", NULL, NULL);
make_trans_font(f);
set_alpha_blender();
textprintf_centre_ex(screen, f, 320, 240, -1, -1, "Anti-aliased Font!");

like… look at that. iconic behavior. πŸ‘‘


🌸 SEE ALSO 🌸


and that's the tea, bestie πŸ“ this was Allegro, version 4.4.3, and it's all about make_trans_font(3alleg4). go make your fonts transparent, you absolute main character πŸ’œπŸ¦‹β­