draw_trans_rle_sprite(3)
π draw_trans_rle_sprite(3) π
okay bestie, we're in the Allegro manual today and this one is genuinely iconic β it's giving ghost sprite energy, and i'm obsessed π«Ά
β¨ NAME β¨
draw_trans_rle_sprite β draws a translucent RLE sprite. it's part of the Allegro game programming library, no cap π
β¨ SYNOPSIS β¨
#include <allegro.h>
void draw_trans_rle_sprite(BITMAP *bmp, const RLE_SPRITE *sprite, int x,
int y);
β¨ DESCRIPTION β¨
so this is literally the translucent version of draw_rle_sprite(). if you wanna know the whole vibe, go read the description of draw_trans_sprite(). π
β οΈ important bestie, do NOT skip this: you can only use this after you've set up the color mapping table (that's for the 256-color modes) or the blender functions (that's for truecolor modes). like, it just won't work otherwise. periodt.
now, about depths β the bitmap and the sprite have to normally be the same color depth, okay? but there's one special case, and it's kind of a slay: you can draw 32-bit RGBA format sprites onto any hicolor or truecolor bitmap, as long as you call set_alpha_blender() first. yes, first. before. not after. π
here's the example, look at her:
/* Some one time initialisation code. */
COLOR_MAP global_trans_table;
create_trans_table(&global_trans_table, my_palette,
128, 128, 128, NULL);
...
if (get_color_depth() == 8)
color_map = &global_trans_table;
else
set_trans_blender(128, 128, 128, 128);
draw_trans_rle_sprite(buffer, rle_ghost_sprite, x, y);
see how she checks the color depth and picks her path? main character behavior fr fr πΈ
β¨ SEE ALSO β¨
draw_rle_sprite(3)draw_lit_rle_sprite(3)draw_trans_sprite(3)color_map(3)set_trans_blender(3)set_alpha_blender(3)bitmap_mask_color(3)
go read those too, they're all part of the same friend group π¦
and that's the whole page, bestie!! this was Allegro, version 4.4.3, and you just read draw_trans_rle_sprite(3) β stay translucent, stay iconic, and don't forget to set your blender functions before you draw πβ¨π
π¦ where this page comes from
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 43: allegro-devel 4.4.3.1-18.fc43 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- fedora 44: allegro-devel 4.4.3.1-20.fc44 Β· Giftware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms