|
Strange problem with transparent png's. |
netcat
Member #6,097
August 2005
|
Attached are two screenshots from two apps, one using allegro and the loadpng library and the other using the FOX GUI toolkit, and also the tileset itself (from RPG Maker XP) so you can see how it is supposed to look. I suspect it might be the semi transparent shadows from the trees and such that causes it, because other images with just transparent backgrounds work fine (and images similar to the attached are broken). Anyone know what's wrong? Is my libpng broken? |
kazzmir
Member #1,786
December 2001
|
Whats the problem? The gigantic black box on the right side in the Allegro application? Other than that the gui and allegro look the same to me. |
netcat
Member #6,097
August 2005
|
You'll see the problem if you look at the third attachment; the loaded image is all screwed up. |
gnolam
Member #2,030
March 2002
|
... all screwed up how? The third attachment looks fine to me. -- |
netcat
Member #6,097
August 2005
|
The third attachment is how it's supposed to look... "the loaded image" = the image as it shows up in the applications. |
kazzmir
Member #1,786
December 2001
|
netcat
Member #6,097
August 2005
|
Simply doing tileset = load_png( ..., 0) ... blit(tileset, buffer, ... ) Also, just tested loading in SDL and it works fine there. |
CGamesPlay
Member #2,559
July 2002
|
The PNG is being loaded without an alpha channel, apparently. I don't know anything about loadpng or FOX GUI though, so I can't help more than that. [append] Here's the same image drawn with Allegro's magic pink as the background. Try using it, instead. You will need to used masked_blit instead of blit. -- Ryan Patterson - <http://cgamesplay.com/> |
Paul whoknows
Member #5,081
September 2004
|
Convert you PNG files to TGA and load it using Allegro. ____ "The unlimited potential has been replaced by the concrete reality of what I programmed today." - Jordan Mechner. |
CGamesPlay
Member #2,559
July 2002
|
Converting it to TGA isn't necessary. He could keep it as PNG like I suggested in my post, or he could use Allegro's software blending techniques: [append] I vote that we call this problem the Invisible Pink Unicorn Syndrome -- Ryan Patterson - <http://cgamesplay.com/> |
netcat
Member #6,097
August 2005
|
CGamesPlay said: set_alpha_blender Doh, hadn't noticed that function before. Calling that makes it work perfectly, obviously. Thanks! |
Paul whoknows
Member #5,081
September 2004
|
____ "The unlimited potential has been replaced by the concrete reality of what I programmed today." - Jordan Mechner. |
|