ID:166487
 
Is there a way to make text on screen that scrolls (Like the old Final Fantasy games) without the lag of creating massive ammounts of objects?
Creating many objects doesn't have to do so much with scrolling as it does with just the text-on-screen part itself. After you get the text on the screen, you don't need to make any more objects, unless you want more to scroll into view. Just change the screen_loc of an object to move it around.
obj/map_text
proc/scroll_up(amount = 16)
var/y_tile = copytext(screen_loc, findtext(screen_loc, ",")+1)
var/y_pixel = copytext(y_tile, findtext(y_tile, ":")+1)
var/x = copytext(screen_loc, 1, length(screen_loc)-length(y_tile)-1)
if(y_pixel) y_tile = copytext(y_tile, 1, length(y_tile)-length(y_pixel)-1)
else y_pixel = "0"
y_tile = text2num(y_tile)
y_pixel = text2num(y_pixel)
y_pixel += amount
while(y_pixel >= 32)
y_pixel -= 32
y_tile += 1
while(y_pixel <= -32)
y_pixel += 32
y_tile -= 1
screen_loc = "[x],[y_tile]:[y_pixel]"

Or something along those lines. Then just call scroll(n) where n is the number of pixels to scroll by.

You also might want to look into giving your screen-text objects variables to keep track of their numeric screen_loc locations so you can just modify them then update screen_loc instead of having to disect screen_loc for the numbers every time.