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:
- Set your drawing mode to
DRAW_MODE_TRANSπ¨ - Then write draw color values in the range
0-255onto 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 π₯
set_alpha_blender(3alleg4)draw_trans_sprite(3alleg4)drawing_mode(3alleg4)exalpha(3alleg4)extrans(3alleg4)
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 πβ¨π
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms