gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Best settings for Grit to encode a PNG with transparency

#153302 - johnnywashngo - Fri Mar 28, 2008 12:30 am

Hi guys,

Bit of a noob to DS homebrew (but not to coding!) and am having a problem trying to get a PNG with transparency to display on screen properly.

I just dont know what I should be putting into my .grit file to tell it what colour the transparency is. The flag -gT{n} seems to be what I am looking for but I am not sure what to put in the {n} part :(

I have had a search through these forums as well as the wider 'net through Google to no avail.

Any suggestions would be greatly appreciated.

Thanks.

#153305 - Cearn - Fri Mar 28, 2008 1:49 am

The best choice is probably to use the 6-figure hex-code for the color. This is formatted as RRGGBB. Examples :
Code:
FF0000 : red
00FF00 : green
0000FF : blue
FF00FF : magenta (the default transparent color)
808080 : gray

This does require that you know what your transparency color is, of course.

#153311 - johnnywashngo - Fri Mar 28, 2008 7:35 am

Cheers Cearn, I will give that a try later on and see how it goes.

As you say, I do need to know what colour my transparency is set to which means I may have rely less on gimp setting the alpha value of the PNG and instead, colour the parts I want to be transparent with a unique colour.

Thanks again.