ID:146281
 
Code:
mob

Login()
..()
CreateName()

proc/CreateName(r=255, g=r, b=r)
overlays = list()
var/lines = round(32 / namefont.height)
var/txt = namefont.GetLines(key, 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)
var/iconset/s2 = new(s)
s2.Dilate()
s2.Transparent(0)
if(30*r+59*g+11*b > 7650) // anything darker than bright red gets white outline
s2.Invert()
s.Transparent() // white text on transparent background
if(r<255 || g<255 || b<255)
s.Blend(rgb(r, g, b), ICON_MULTIPLY)
s.BlendSet(s2, 0, 0, ICON_UNDERLAY)
var/obj/O = new
O.pixel_y = -32
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)

Logout()


Problem description:

I noticed that using Lummox Jrs DMI Fonts, when you put it into your game, it makes it so that it shows you Key as the text ander your name. How do I make it so it shows YOUR NAME not key under you charcter?

I wasn't sure what to do so I didn't mess with the code.
Crzylme wrote:
I noticed that using Lummox Jrs DMI Fonts, when you put it into your game, it makes it so that it shows you Key as the text ander your name. How do I make it so it shows YOUR NAME not key under you charcter?

Naturally you'd use name, not key, as the var in the call to GetLines().

Lummox JR
In response to Lummox JR
I did not see that thank you. Another thing.... How do I get it to show an overlay when logging into the game?? because right now it won't let me.