|
|
| A4 blit Equivalent |
|
AceBlkwell
Member #13,038
July 2011
|
I'm working on an old unfinished A4 project. Converting it to A5. I have a bitmap with a pink background. When I put it on the screen it remains pink. So I'm assuming the blit takes care of this. Is there a blit equivalent for A5? |
|
Dizzy Egg
Member #10,824
March 2009
|
That's the old "magic pink", which was traditionally used as a mask colour. In A5 you will need to call: al_convert_mask_to_alpha(your_bitmap, al_map_rgb(255, 0, 255)); Where "your_bitmap" is the ALLEGRO_BITMAP* you want to create alpha for. That will turn the pink into an alpha channel.
---------------------------------------------------- |
|
AceBlkwell
Member #13,038
July 2011
|
Thanks Dizzy. Worked like a champ. Is there another way of making areas transparent, if "pink" is an old style approach? |
|
DanielH
Member #934
January 2001
|
If it is a file you're loading then do what I do. Open it in a paint program that can manipulate the alpha channel. Set the alpha value of the pink pixels to 0 and save it. May have to convert to another format, not sure. I use .png for all my bitmap files. If not then yes, this is what you do: al_convert_mask_to_alpha(your_bitmap, al_map_rgb(255, 0, 255));
|
|
AceBlkwell
Member #13,038
July 2011
|
Thanks Daniel. Will that negate the need for converts or does it just change the pink to black? |
|
DanielH
Member #934
January 2001
|
Only sets the alpha channel to 0. Doesn't change the r, g or b. al_convert_mask_to_alpha Either do it manually pre-load like I do or post-load with al_convert_mask_to_alpha. |
|
Edgar Reynaldo
Major Reynaldo
May 2007
|
Don't use transparent pink, except in your old sprites, and then as everyone said, convert the mask to alpha, but make it transparent black in your paint program, or transparent white, for blending purposes. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
|
AceBlkwell
Member #13,038
July 2011
|
Gotcha, so basically building the Thanks Edgar. I thought pink was the only color it would work with. Didn't realize you could use other colors. Thanks |
|
DanielH
Member #934
January 2001
|
Just looked at source. al_convert_mask_to_alpha converts any pixel that matches your color to RGBA (0,0,0,0) |
|
|