Understanding the language, error messages, etc.
Post a reply

White pixels are transparent

Wed Aug 10, 2016 4:20 pm

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

Wed Aug 10, 2016 5:09 pm

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

Wed Aug 10, 2016 8:05 pm

so I did
Code:
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

Wed Aug 10, 2016 8:07 pm

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

Thu Aug 11, 2016 2:44 am

the guide found here........

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

should answer your questions and more.
Post a reply