This is what I'm currently doing to achieve text with borders:
/*
var/dmg_amount
To use call: damage_number(src,dmg_amount=50,"#CC66FF")
*/
// hp.Subtract(s)
// damage_number(src,s,"#CC66FF")
proc
damage_number(atom/a,number, color = "#fff", layer = MOB_LAYER + 1, duration = 5, x_add=0, y_add=0)
var/obj/number_obj = a.map_label(number, color, bold = 1, width = 64, layer = layer, xadd = x_add, yadd = y_add)
if(isturf(a))
number_obj.loc = a
else if(istype(a, /atom/movable))
var/atom/movable/m = a
number_obj.loc = m.loc
number_obj.step_x = m.step_x + m.bound_x
number_obj.step_y = m.step_y + m.bound_y
number_obj.pixel_x = a.pixel_x
number_obj.pixel_y = a.pixel_y - 1
number_obj.pixel_z = a.pixel_z
spawn()
sleep(duration * world.tick_lag)
for(var/i = 0 to 12)
number_obj.pixel_z += 3
sleep(world.tick_lag)
del number_obj
atom/proc
map_label(maptext, color = "#fff", bold = 0, layer = MOB_LAYER, width = 32, pixel_x = 0, pixel_y = 0, xadd = 0, yadd = 0)
var/plain_text = maptext
var/pos = findtext(plain_text, "<font")
while(pos > 0)
var/end = findtext(plain_text, ">", pos)
plain_text = copytext(plain_text, 1, pos) + copytext(plain_text, end + 1)
pos = findtext(plain_text, "<font")
if(isnull(plain_text))
plain_text = maptext
bold?(bold="<b>"):(bold = "")
var/obj/o = new()
o.maptext_width = width
o.maptext = "<font color=[color]>[bold][maptext]"
o.layer = layer + 0.1
o.pixel_x = pixel_x
o.pixel_y = pixel_y
o.maptext_x = xadd
o.maptext_y = yadd
var/obj/o1 = new()
o1.maptext = "<font color=#000>[bold][plain_text]"
o1.maptext_width = width
o1.layer = layer
o1.pixel_x = 1
o1.pixel_y = pixel_y
o1.maptext_x = xadd
o1.maptext_y = yadd
var/obj/o2 = new()
o2.maptext = "<font color=#000>[bold][plain_text]"
o2.maptext_width = width
o2.layer = layer
o2.pixel_x = -1
o2.pixel_y = pixel_y
o2.maptext_x = xadd
o2.maptext_y = yadd
var/obj/o3 = new()
o3.maptext = "<font color=#000>[bold][plain_text]"
o3.maptext_width = width
o3.layer = layer
o3.pixel_y = pixel_y
o3.pixel_z = 1
o3.maptext_x = xadd
o3.maptext_y = yadd
var/obj/o4 = new()
o4.maptext = "<font color=#000>[bold][plain_text]"
o4.maptext_width = width
o4.layer = layer
o4.pixel_y = pixel_y
o4.pixel_z = -1
o4.maptext_x = xadd
o4.maptext_y = yadd
o.underlays.Add(o1, o2, o3, o4)
/* o.underlays += o1
o.underlays += o2
o.underlays += o3
o.underlays += o4*/
return o
Mod as you wish.