Drawing partially transparent, translucent bitmaps


I have a somewhat special problem with allegro 4.4 and transparence.

I used to draw bitmaps over bitmaps with mask_blit. Everyone does.

But know the rules changed. B has a part which is partially transparent,
translucent, whatever you want to call it.

Masked_blit didn't work at all. It changes the color to something similar
to magic pinc, but won't show the background (A).

When I use trans_sprite it will end up in drawing everything in this bitmap
partially translucent, which is not wanted.

Can someone advise me how to solve this thing, since changing the "environment" would be worky -)

Edgar Reynaldo

You can't mix transparent (magic pink) and translucent (alpha blended) images together. It just doesn't work. What you can do is convert a certain color to zero alpha though, with al_convert_mask_to_alpha.


I almost solved the puzzle. But now, I encountered a strange behaviour of allegro.

It only! draws parts where transparency is included, which is somewhat totally useless. Did someone find the same thing.

Maybe I can work around, by completely redrawing.

Edgar Reynaldo

What gets drawn depends on the blender in use. The default is a pre-multiplied alpha blender.

Thread #615557. Printed from Allegro.cc