ID:145469
 
Code:
mob
proc/CreateLevel(r=255, g=r, b=r)
overlays += list()
var/lines = round(32 / namefont.height)
var/txt = namefont.GetLines("[usr.Level]", width = 96, maxlines = lines,\
flags = DF_WRAP_ELLIPSIS)
var/size = namefont.RoundUp32(namefont.GetWidth(txt))
var/iconset/s = namefont.DrawText(txt, size / 2, 0,\
width = size, maxlines = lines,\
flags = DF_JUSTIFY_CENTER | DF_WRAP_ELLIPSIS,\
icons_x = size / 32, icons_y = 1)
s.Transparent() // white text on transparent background
if(r<255 || g<255 || b<255)
s.Blend(rgb(r, g, b), ICON_MULTIPLY)
var/obj/O2 = new
O2.pixel_y = 10
O2.layer = 3
for(var/xx = 0, xx < s.w, ++xx)
var/icon/ic = s.GetIcon(xx, 0)
if(ic)
O2.icon = ic
O2.pixel_x = (xx + (1 - s.w) / 2) * 32
overlays += O2
del(O2)


Problem description:
what i want to do is make it so that it will refresh my level... i tried calling the proc again but it overlays the previous number.. Ive been trying to figure this out for days... can someone help me?

Delete the original overlay, then call it again.
In response to Crashed
I have tried but after the proc gets called I cant address the vars in the proc anymore.