Page 1 of 1

White pixels are transparent

PostPosted: Wed Aug 10, 2016 4:20 pm
by noah
Hi, so I made a little sprite that moves around a map, but my floor tiles have dot textures on, and they appear in the face of my character, even though I filled the face in white before converting to hexadecimal. Is there any way to change this? Or should I just remove the dots from the floor?

Thanks in advance, -noah

Re: White pixels are transparent

PostPosted: Wed Aug 10, 2016 5:09 pm
by Sorunome
When using gb.drawBitmap with color set to BLACK, white pixels are indeed rendered as transparent. The work-around is to draw e.g. a white rectangle on where you want to draw your sprite first.

Re: White pixels are transparent

PostPosted: Wed Aug 10, 2016 8:05 pm
by noah
so I did
Code: Select all
gb.display.setColor(white, white);
gb.display.fillRect(playerX, playerY, 10, 10);

(10 is the width/height of my sprite) before drawing the bitmap, and now they have completely disappeared!
Why is this?

thanks, noah

Re: White pixels are transparent

PostPosted: Wed Aug 10, 2016 8:07 pm
by noah
Hi,
I fixed the sprite disappearing by setting color back to black before drawing the bitmap but now the walls and ground show through them again. Not quite sure what to do...

Re: White pixels are transparent

PostPosted: Thu Aug 11, 2016 2:44 am
by Duhjoker
the guide found here........

viewtopic.php?f=8&t=3440#p11603

should answer your questions and more.