ID:177093
 
I am trying to make a proc to display text on the screen, while it does work it does not work the way I'd like it to.
proc Text_On_Screen(mob/M, var/text, var/x, var/y) for(var/a=1;a<=length(text);a+=2) var/b = copytext(text,a,a+1) var/obj/L = new/obj L.screen_loc = "[round(a/2)+1],2" L.icon = 'font.dmi' L.icon_state = "[lowertext(b)]" M.client.screen += L var/c = copytext(text,a+1,a+2) var/obj/N = new/obj N.screen_loc = "[round(a/2)+1],1" N.icon = 'font.dmi' N.icon_state = "[lowertext(c)]" N.pixel_x += 16 M.client.screen += N
the output is something like this:
note: it calls Text_On_Screen(usr,"hello",2,2)
H L O E L
I intentionally put them on separate lines. However I want the bottom line to be shifted over 16 pixels. I have tried tinkering around with it a bit, but nothing has worked. Somebody please help.
What's wrong is that pixel_x and pixel_y don't work for screen objects. You have to set their pixel offsets in screen_loc, like this: "x:pixel_x,y:pixel_y". I don't know exactly why Dantom chose for it to work like this, but it's probably just so objects can have entirely different screen and map locations without them affecting each other.

-AbyssDragon