How to display gold in custom HUD.

After some help figuring out why my text was blurry (thank you all), I now have realized, I don't know how I would display the player's gold in the HUD I've designed. I've given spots to display up to 9 digits, or up to 999,999,999 gold and I want to keep it in the same font as the rest of the HUD which is just pixel art letters/numbers I got from itch.io. I know there's a way to display Gold on screen at all times, but as far as I know, that wouldn't show in the font I want it to. I know I can tie the player's gold to a variable and based on that variable, display a different number but doing an "If PlayerGold = 1, then showpicture Gold-1" for all 999,999,999 would be absurd and not worth the effort. Surely there's an easier way or some kind of plugin that would make it work. My only other thought was if there was a way to check if player gold is a value with a 5 in the 10's place, then display a the number 5 in that 10's place box, but I have no idea if RMMZ has that capability.
There's a plugin MOG_GoldHud that does that, it's 300 lines of code and basically converts the gold integer value into an array of image references. I don't know if there is an MZ version or maybe the MV version will work in MZ but you could try it out

After some help figuring out why my text was blurry (thank you all), I now have realized, I don't know how I would display the player's gold in the HUD I've designed. I've given spots to display up to 9 digits, or up to 999,999,999 gold and I want to keep it in the same font as the rest of the HUD which is just pixel art letters/numbers I got from itch.io. I know there's a way to display Gold on screen at all times, but as far as I know, that wouldn't show in the font I want it to. I know I can tie the player's gold to a variable and based on that variable, display a different number but doing an "If PlayerGold = 1, then showpicture Gold-1" for all 999,999,999 would be absurd and not worth the effort. Surely there's an easier way or some kind of plugin that would make it work. My only other thought was if there was a way to check if player gold is a value with a 5 in the 10's place, then display a the number 5 in that 10's place box, but I have no idea if RMMZ has that capability.
You sure can! That's just simple maths, really.

Say you have 76,850 gold.

Getting the 10,000s place just requires dividing the value by 10,000, giving you 7.

Modulus 10,000 to remove the 10,000s place, and you're left with 6,850.

Divide by 1000 to get the 1000s, 6.

Modulus 1000 to remove the 1000s, and you're left with 850.

And so on and so forth...

Then each digit will only require 10 value branches (except the very leftmost one which will only need 9, since it can't have a value of 0).

You'll have to increase the power of 10 for each subsequent digit.
There's a plugin MOG_GoldHud that does that, it's 300 lines of code and basically converts the gold integer value into an array of image references. I don't know if there is an MZ version or maybe the MV version will work in MZ but you could try it out


Oh excellent! They do in fact have an MZ version, but I'm stuck because I'm not quite sure what to do from there. I have the .js file open and can see all of the code, but do you know how I get it to work? I don't see any kind of guide to it anywhere online on where to add the images for it to do display according to what the number is.
I would go with the solution @Trihan suggested as you can use your very own pictures for each digit. It's quite easy to set up. I once did this in RPG Maker 2003 many years ago. It's easy to set up, the Modulo will do all the work for you. You have to just add IFs like there's no tomorrow, but this would do it.

Bild_2023-07-25_185254279.png
Oh excellent! They do in fact have an MZ version, but I'm stuck because I'm not quite sure what to do from there. I have the .js file open and can see all of the code, but do you know how I get it to work? I don't see any kind of guide to it anywhere online on where to add the images for it to do display according to what the number is.
The following files will be required. (img/system/)

Gold_A.png
Gold_B.png

It basically wants two files in this format:
1690304160564.png
I would go with the solution @Trihan suggested as you can use your very own pictures for each digit. It's quite easy to set up. I once did this in RPG Maker 2003 many years ago. It's easy to set up, the Modulo will do all the work for you. You have to just add IFs like there's no tomorrow, but this would do it.

View attachment 270682
If you use two variables, one to hold the current place value, you can use division along with modulo to turn every part of the number into a single-digit reference, so you only need 0-9 branches for every place.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-display-gold-in-custom-hud.159700/