3 posts
Posted 20 October 2012 - 06:10 PM
So, i'm trying something out which will probably lead to a chatroom of some sort, basically, i want it so when somethings printed on screen, the cursor is set to a new line. If you need code so far, i can post it for you.
Any help greatly appreciated, thanks!
318 posts
Location
Somewhere on the planet called earth
Posted 20 October 2012 - 06:11 PM
print("text") automaticly goes to next line after use
231 posts
Posted 20 October 2012 - 06:11 PM
So you want it print text, scroll a line up, and set the cursor to the line below where it printed?
3 posts
Posted 20 October 2012 - 06:13 PM
So you want it print text, scroll a line up, and set the cursor to the line below where it printed?
Yeah, basically.
231 posts
Posted 20 October 2012 - 06:16 PM
So you want it print text, scroll a line up, and set the cursor to the line below where it printed?
Yeah, basically.
print("text")
local x, y = term.getSize()
local xPos, yPos = term.getCursorPos()
if yPos < y then
term.scroll(1)
end
Print automatically scrolls if its the last line, so this makes it only scroll one line up if its not the last line.
2005 posts
Posted 20 October 2012 - 06:22 PM
Won't that make it hard to see the history of the chat? What if you started on the first or second line?
231 posts
Posted 20 October 2012 - 06:24 PM
Ideally you'd set the cursor position mostly down the page first, to give just enough space for where you input the chat. Of course it would also scroll any parts of the interface, such as the input box itself
3 posts
Posted 20 October 2012 - 06:31 PM
Thanks guys, this really helped.