term.scroll

From ComputerCraft
Jump to navigation Jump to search

term.scroll
Function
Syntax
term.scroll()
Returns nil
API term
Source CC:Tweaked (source)

Moves everything on the screen by distance lines. distance may be positive or negative. A positive distance will scroll the terminal up (new blank lines appear at the bottom), whereas a negative distance will scroll the terminal down (new blank lines appear at the top).

ExampleExampleMoves "Hello World!" up 3 pixels, and then prints "This text was printed 3 pixels below 'Hello World!"
Code
term.clear()
term.setCursorPos(1,4)
print("Hello World!")
term.scroll(3)
print("This text was printed 3 pixels below 'Hello World!'")
Output
Hello World!



This text was printed 3 pixels below 'Hello World!'