Understanding the language, error messages, etc.
by noah » 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
-
noah
-
- Posts: 25
- Joined: Mon Jul 25, 2016 8:32 am
- Location: Spiffin' Britain
-
by Sorunome » 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.
-
Sorunome
-
- Posts: 629
- Joined: Sun Mar 01, 2015 1:58 pm
-
by noah » Wed Aug 10, 2016 8:05 pm
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
-
noah
-
- Posts: 25
- Joined: Mon Jul 25, 2016 8:32 am
- Location: Spiffin' Britain
-
by noah » 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...
-
noah
-
- Posts: 25
- Joined: Mon Jul 25, 2016 8:32 am
- Location: Spiffin' Britain
-
Return to Programming Questions
Who is online
Users browsing this forum: No registered users and 9 guests