Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Drawing partially transparent, translucent bitmaps

This thread is locked; no one can reply to it. rss feed Print
Drawing partially transparent, translucent bitmaps
#00JMP00
Member #14,740
November 2012

Hi!

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

I used to draw bitmaps over bitmaps with mask_blit. Everyone does.
A+B

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
Member #8,592
May 2007
avatar

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.

#00JMP00
Member #14,740
November 2012

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
Member #8,592
May 2007
avatar

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

Go to: