proc/CreateName2(r=255, g=r, b=r,T as text,r2,g2,b2)
overlays = list()
var/lines = round(32 / startfont.height)
var/txt = startfont.GetLines(T, width = 2000, maxlines = lines)//,//\
//flags = DF_WRAP_ELLIPSIS)
var/size = startfont.RoundUp32(startfont.GetWidth(txt))
var/iconset/s = startfont.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
s.Dilate()
s.Transparent()
if(r<255 || g<255 || b<255)
s.Blend(rgb(r, g, b), ICON_MULTIPLY)
var/obj/O = new
O.layer=MOB_LAYER+100
O.pixel_y = 0
for(var/xx = 0, xx < s.w, ++xx)
var/icon/ic = s.GetIcon(xx, 0)
if(ic)
O.icon = ic
O.pixel_x = (xx + (1 - s.w) / 2) * 32
overlays += O
del(O)
var/iconset/m = startfont.DrawText(txt, size / 2, 0,\
width = size, maxlines = lines,\
flags = DF_JUSTIFY_CENTER | DF_WRAP_ELLIPSIS,\
icons_x = size / 32, icons_y = 1)
m.Transparent() // white text on transparent background
// s.Dilate()
if(r2<255 || g2<255 || b2<255)
m.Blend(rgb(r2, g2, b2), ICON_MULTIPLY)
var/obj/o = new
o.layer=MOB_LAYER+100
o.pixel_y = 0
for(var/xx = 0, xx < m.w, ++xx)
var/icon/ic = m.GetIcon(xx, 0)
if(ic)
o.icon = ic
o.pixel_x = (xx + (1 - s.w) / 2) * 32
overlays += o
del(o)
Don't worry about the indentation... but this is just displaying the text wrong in a odd position.
Lummox JR