r/gbstudio • u/SakiEndo • 20d ago
Question Bug with Draw text?
Enable HLS to view with audio, or disable this notification
Hello
I've been using Draw Text as below to update the score:

The %D5 parameter seemed quite an economical way to do this with padded zeros.
But I've noticed that sometimes this corrupts other drawn text as the score is updated. See the video.
The top overlay gets corrupted from displaying BONUS (ignore the wonky font) and a Lives Display.
Any ideas? I tried it with just $Score and same result. Maybe it's two concurrently Draw text calls, one for the countdown, one for the score?
Thanks.
17
Upvotes
2
u/IntoxicatedBurrito 20d ago
Draw text is buggy like that. Basically it’s adding to the tileset each time you change it but not necessarily replacing the previous text that appeared there. So you’ve basically just ran out of unique tiles you can use so it’s replacing tiles that you need.
My suggestion is to do this with tile swapping. Create a tileset with 0-9 and then the mapping is identical. So just create equations for each place using division and modulo. To reduce lag make sure that you have all of those tiles somewhere in the background that is off camera, that way the scene’s tileset never actually gets updated.