Sign in to follow this  
kelcharge

Alpha Blending in Allegro?

Recommended Posts

kelcharge    180
I'm using Dev-C++ and Allegro, and in my game I have a character that is a 16x16 image, but he always seems to have a black box surrounding him. I would like to know how I can get that box to have an alpha of 0, but just the box not the character.

Share this post


Link to post
Share on other sites
konForce    592
It sounds like you want simple transparency.

If you are in 8-bit color depth, any color with 0 is considered transparent.

If you are in 15,16,24,32 bit color depth, any color of RGB FF00FF is considered transparent.

Using the "draw sprite" or "masked blit" functions with an image as defined above will eliminate your "black box border" problem.

Share this post


Link to post
Share on other sites
23yrold3yrold    941
Right; sounds like you're using black in a situation where "hot pink" is expected. [smile] If you still can't get it, tell us the color depth you're using, and maybe post the sprite ...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this