ID:147245
 
Alright, I can't quite get this to work correctly.
mob
proc/scroll_text()
for(var/obj/back/B in client.screen)
if(B.icon_state=="ul"||B.icon_state=="ur"||B.icon_state=="t")
for(var/obj/text/T in client.screen)
if(T.loc==B.loc)

del T
T.loc=locate(T.x,T.y+1,T.z)

I'm looking for this procedure to find all of the text objects that shares a tile with all back objects with the icon states of "ul", "t" , or "ur" and delete those text objects. All the remaining text objects in client.screen I'd like to slide up 16 pixels.

I don't know if this is the best way to give the text on screen a scrolling-up look, which is what I'm looking for.

If anyone has a better idea on how I can go about doing this, please share your thoughts.
Since you are working with screen objects, you want to use screen_loc instead of loc. To raise something by 16 pixels, just put that in the text string as shown in the help file.

Also, you can use the following function to get a raised screen_loc. Just pass in the screen loc and the amount to raise it.
proc/RaiseScreenLoc(screen_loc,N=16)
var
seperator_loc=findtext(screen_loc,",")
x=copytext(screen_loc,1,seperator_loc)
y=copytext(screen_loc,seperator_loc+1,0)
y_offset=0
seperator_loc=findtext(y,":")
if(seperator_loc)
y_offset=text2num(copytext(y,seperator_loc+1,0))
y=text2num(copytext(y,1,seperator_loc))
y_offset+=16
if(y_offset>=32)
y_offset-=32
y+=1
y=text2num(y)
if(y_offset)
y+=":[y_offset]"
return "[x],[y]"