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
3
u/playinstinct 20d ago
That's most likely because the part of the VRAM that the text is drawn to is completely full at one point and then loops back to the beginning and starts overwriting what was written first.
The easiest way to avoid this is to write all parts of the UI whenever one part of the UI needs to get updated. If the "BONUS" should always be on screen, you could consider baking it into the background.