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 Misc > Black sprite becomes transparent

#175759 - MichaelMossman - Wed Feb 02, 2011 7:08 pm

I have created a completely black square using Paint Shop Pro.

The only trouble is that grit renders this as a string of zeros with a matching zero palette. This of course becomes transparent.

How do I get round this ?

#175760 - JanoSicek - Thu Feb 03, 2011 11:23 am

Obviously your sprite needs to be all ones (1,1,1,1,) with palette entry for 1 equal to 0,0,0

Maybe if you change the black color to #000001 instead of #000000 it will convert as intended.

#175761 - sverx - Thu Feb 03, 2011 11:44 am

grit has a parameter to specify which color is the transparent: -pT<n>. For instance if the transparent color is 225 then you should do
Code:
-pT225

of course if you've got a completely black palette you're not using for anything else even -pT1 should be ok.

#175763 - MichaelMossman - Thu Feb 03, 2011 2:43 pm

I'm sorry but I really don't know how to cange the sprite from 'all zero' to 'all one' - grit does this for me.

However, adding in the -pT parameter did the trick fine.

My only problem now is the one I posted on the next topic.

When I tried to check the .s file to see what effect this parameter had had, they have all disappeared.