#2210·gb-studio

Allow setting the leading character used with Fixed Length variables (%D)

Author: nicholasbrantleyCreated Aug 28, 2026Updated Aug 30, 2026
Labelsenhancement

Is your feature request related to a problem? Please describe.

I have 2 counter displays in my HUD, one being the score, that shows leading zeros. To emulate the appearance of a LCD number display, I want leading zeros to be a different "zero" character in my custom font, so they appear to be "unlit", but %D does not allow changing it.

A more common use case I can think of that this would work for is if you want fixed length with leading spaces instead of zeros, to allow right aligning text.

Describe the solution you'd like

It would be nice to have a way to set the character used by %D, I don't know what syntax would be best but I imagine 2 possible ways. Assuming $myvariable = 42:

  1. A separator after the length number and the ASCII character code after it:

    • %D5|65$myvariable would print AAA42 instead of 00042
  2. A text command that sets the leading length character:

    • !Leading, behaving similarly to !Wait where you put a number with it, showing as L(65) in the text field. All %D after it in the text field would use A.

Describe alternatives you've considered

Trying it with tile swapping is much more tedious for score displaying since it requires either using the expensive modulus function or storing each digit as separate variables.

Additional context

What I want to achieve:

Image

What I have to settle for when drawing text and using %D:

Image