ID:140243
 
Code:
mob/proc
Text(Text as text, x,y, Talking)
var
list/Images = list()
len = lentext(Text)
for(var/position = 1, position <= len,)
var/atom/movable/Text/text = new(src.client,x,y, copytext(Text, position, ++position), position * 16+16)
src << text.pixel_x
Images += text
return Images
atom/movable
Text
name = "text"
icon = 'charset.dmi'
layer = 150
pixel_y = 16

New(client/C,x,y, state,px)
pixel_x = px
icon_state = state
screen_loc = "[x],[y]"
C.screen+=src


Problem description:
Alright this is a proc to print text to the user's screen. It all prints yes, but it all prints in the same spot because it is not being affected by pixel_x and pixel_y, I'm not use to this language, can any one help me out?
Check the reference entry on screen_loc again, it has a special format for pixel offsets on the screen.
I think the problem is that screen loc overrides pixel_x and pixel_y. You can specify pixel offsets in screen locations with a colon, like so: "0:16, 1:8". This is detailed on the screen loc reference page.

Incidental: You probably shouldn't preincrement position and use position in the same line like that. Specifically, this:

var/atom/movable/Text/text = new(src.client,x,y, copytext(Text, position, ++position), position * 16+16)


I believe that would be okay in C/C++ (because , is a sequence point), but I'm not sure that's the case in DM.
In response to Jp
Thank you, problem solved. didn't know about the screen_loc var.
In response to Nadrew
Thank you, problem solved. didn't know about the screen_loc var. And your demos have been helpful to me.