mob/proc/GoldHUD()
var/t = "[usr.gold]"
var/pixX = 0
for(var/i = 1, i <= length(t), i++)
var/obj/number= new()
var/a = copytext(t,i,i+1)
numb.icon = 'numbers.dmi'
numb.icon_state = "[a]"
numb.screen_loc = "15:[pixX],2"
usr.client.screen += number
pixX +=32</b>
Problem description:I have tried numerous things with this code, but keep running into the same problem. The procedure updates the user's gold just fine on the HUD, but does not delete the numbers that were added at the last call of GoldHUD().
For example, if a user has 1000 gold, the HUD will display 1000, but if the user later spends 100 gold, the HUD will display 9000 instead of 900 because the old numbers are still displaying.
Any help would be greatly appreciated :)
I suggest using maptext instead of an object per-char, but you might have special graphical text that you really want to use.