Transparency in bitmaps of Allegro 5
Hello. I'm unsing Allegro 5 here and I didn't find any function that makes my bitmap transparent. On the old Allegro, the functions for this were:
Could anyone help and tell me what I have to do in the new Allegro?
Thanks a lot!
It works with the alpha channel. Something like:
al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgb(255,255,255));
From here, the first thing that caught my eye was al_convert_mask_to_alpha
Thanks Matthew. That was what I needed!
Thanks anyway OnlineCop. But that function I use to transform my bitmaps from pink to alpha. I want half transparency
Thread #598765. Printed from Allegro.cc
You can do this too, to give any bitmap a degree of translucency:
// load bitmap
int alpha = 128; // half translucent
al_set_blender(ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA, al_map_rgba(255, 255, 255, alpha));
al_draw_bitmap(bmp, 0, 0, 0);