Difference between revisions of "Term (API)"

From ComputerCraft Wiki
Jump to: navigation, search
m (moved TERM to Term (API))
(added more info about functions returning multiple arguments.)
Line 14: Line 14:
 
|-
 
|-
 
|term.getCursorPos()
 
|term.getCursorPos()
|Returns position of the cursor
+
|Returns two arguments containing the x and the y position of the cursor
 
|-
 
|-
 
|term.setCursorPos( x, y )
 
|term.setCursorPos( x, y )
Line 23: Line 23:
 
|-
 
|-
 
|term.getSize()
 
|term.getSize()
|Gets the size of the screen. (Good for if you're making something to be compatible with both [[Turtles]] and [[Consoles]].
+
|Returns two arguments containing the x and the y values stating the size of the screen. (Good for if you're making something to be compatible with both [[Turtles]] and [[Consoles]].
 
|-
 
|-
 
|term.scroll( n )
 
|term.scroll( n )

Revision as of 00:35, 4 March 2012

The Terminal API provides functions for ASCII graphics.

Method name Description
term.write( text ) Writes text to the screen.
term.clear() Clears the entire screen
term.clearLine() Clears the line the cursor is on
term.getCursorPos() Returns two arguments containing the x and the y position of the cursor
term.setCursorPos( x, y ) Sets the cursor's position.
term.setCursorBlink( b ) Disables the blinking or turns it on.
term.getSize() Returns two arguments containing the x and the y values stating the size of the screen. (Good for if you're making something to be compatible with both Turtles and Consoles.
term.scroll( n ) Scrolls the terminal.