var/icon/ColorNPC='Alphabet.dmi'
obj/Supplemental/NameDisplay
icon='Alphabet.dmi'
atom/proc/Name(var/Name2Add)
var/spot=0
var/letter=" "
if(!Name2Add) Name2Add=src.name
for(var/O in src.overlays)
if(O) if(O:name=="NameDisplay") src.overlays-=O
else src.overlays-=O
while(letter!="")
spot+=1
letter=copytext(Name2Add,spot,spot+1)
if(letter=="") return
var/px=(spot*6)-(length(Name2Add)*6)/2
var/obj/Supplemental/NameDisplay/NL=new
NL.pixel_x=px
NL.icon_state="[letter]"
NL.pixel_y=-10
NL.layer=99999999999999999
usr.overlays+=NL
Problem description:
Problem i got a problem with this code I want it to show name without any spaces but when my game starts some of the letters are shown with space. can some one help me?
I'd recommend using Lummox JR's DMIFontsPlus library.
It can do variable width fonts (so that i takes up less space than w) and even has an easy-to-use proc to generate name graphics and attach them to objects.