set_alpha_blender(3alleg4)

✨ set_alpha_blender ✨

okay bestie, so this is a page from the Allegro manual (that's the 3alleg4 girlies, version 4.4.3 if you were wondering), and today's main character is set_alpha_blender β€” she turns on a special alpha-channel blending mode. πŸ’… Allegro game programming library, no cap.


πŸ¦‹ NAME πŸ¦‹

set_alpha_blender β€” Enables a special alpha-channel blending mode. Allegro game programming library.


πŸŽ€ SYNOPSIS πŸŽ€

#include <allegro.h>

void set_alpha_blender();

πŸ’– DESCRIPTION πŸ’–

okay so listen. This function enables the special alpha-channel blending mode, and that mode is literally the one you use for drawing 32-bit RGBA sprites. ✨

After you call this function, you can use draw_trans_sprite() or draw_trans_rle_sprite() to draw a 32-bit source image onto any hicolor or truecolor destination. The alpha values get taken directly from the source graphic, so you can vary the solidity of each part of the image. Like, per-pixel vibes. Obsessed. 🫢

⚠️ but bestie, here's the catch β€” while this mode is active you can't use any of the normal translucency functions. So reset to one of the normal blender modes (eg. set_trans_blender()) before drawing anything that isn't a 32-bit RGBA sprite. Don't skip this step, it's giving consequences. πŸ’€

🌸 SEE ALSO 🌸


and that's the whole page, bestie πŸŽ€ this was Allegro, version 4.4.3 β€” slay, go blend some sprites, ily πŸ’œπŸ‘‘