SET_WRITE_ALPHA_BLENDER(3alleg4)

✨ NAME ✨

set_write_alpha_blender β€” bestie, this is the one that turns on the special alpha-channel editing mode πŸ’… and it lives in the Allegro game programming library πŸŽ€


🌸 SYNOPSIS 🌸

#include <allegro.h>

void set_write_alpha_blender();

πŸ’– DESCRIPTION πŸ’–

Okay so listen. set_write_alpha_blender() switches on the special alpha-channel editing mode β€” the fancy secret door πŸšͺ✨ β€” and what that mode is for is drawing alpha channels right on top of an existing 32-bit RGB sprite, so you can glow it up and turn it into an RGBA format image. It's giving makeover montage. πŸ¦‹

Once you've called this function, here's the recipe, no cap:

  1. Set your drawing mode to DRAW_MODE_TRANS 🎨
  2. Then write draw color values in the range 0-255 onto a 32-bit image

And the magic part? The color values stay exactly where they are β€” untouched, unbothered, thriving β€” but the alpha gets altered to whatever values you're writing. So you're literally editing the transparency layer and leaving the pixels alone. Iconic. πŸ‘‘

Bonus: after you've enabled this mode, you can also use draw_trans_sprite() to superimpose an 8-bit alpha mask over the top of an existing 32-bit sprite. Two-for-one deal, we love to see it. 🫢


πŸ”₯ SEE ALSO πŸ”₯


K that's the whole page, bestie πŸ’œ this is Allegro, version 4.4.3, and yeah β€” go forth and edit those alpha channels, you absolute legend 🌈✨πŸ’