|
al_draw_tinted_bitmap_region and transparency |
23yrold3yrold
Member #1,134
March 2001
|
Does al_draw_tinted_bitmap_region ignore the alpha value in ALLEGRO_COLOR? // draws the bitmap normally al_draw_tinted_bitmap_region(image, al_map_rgba(255, 255, 255, 255), 0, 0, 40, 40, 0, 0, 0); // draws the bitmap normally (same as above) al_draw_tinted_bitmap_region(image, al_map_rgba(255, 255, 255, 0), 0, 0, 40, 40, 0, 0, 0); // draws the bitmap tinted purple al_draw_tinted_bitmap_region(image, al_map_rgba(255, 0, 255, 0), 0, 0, 40, 40, 0, 0, 0); The code documentation implies that the alpha should affect al_draw_tinted_bitmap_region() like it affects al_draw_tinted_bitmap() ... if it doesn't that's inconvenient. -- |
Matthew Leverton
Supreme Loser
January 1999
|
Which blender are you using? It's pre-multiplied by default: al_set_blender(ALLEGRO_ADD, ALLEGRO_ONE, ALLEGRO_INVERSE_ALPHA) which means you have to call: al_map_rgb(r*a,g*a,b*a,a). Edit: Oh, this is the tinted functions. Not sure how those work, or if any of the above applies. |
23yrold3yrold
Member #1,134
March 2001
|
I have yet to explicitly use a blender. Passing an ALLEGRO_COLOR has pretty much been doing it for me ... -- |
Matthew Leverton
Supreme Loser
January 1999
|
Looks like I'm right. See thread discussions on the al_draw_tinted_bitmap() page. |
23yrold3yrold
Member #1,134
March 2001
|
Hmmm. That's a little odd IMHO, but ... okay! It does work ... -- |
Matthew Leverton
Supreme Loser
January 1999
|
It's okay. I'll be answering this same question for the rest of my life. |
Elias
Member #358
May 2000
|
In return you'll never have to answer questions about why sprites get mysterious dark outlines -- |
|