Difference between revisions of "Term (API)"
From ComputerCraft Wiki
(Added a missing parentheses.) |
|||
Line 4: | Line 4: | ||
!style="background:#EEE" width="*"|Description | !style="background:#EEE" width="*"|Description | ||
|- | |- | ||
− | |[[ | + | |[[term.write|term.write( text )]] |
|Writes text to the screen. | |Writes text to the screen. | ||
|- | |- | ||
− | |[[ | + | |[[term.clear|term.clear()]] |
|Clears the entire screen | |Clears the entire screen | ||
|- | |- | ||
− | |[[term.clearLine()]] | + | |[[term.clearLine|term.clearLine()]] |
|Clears the line the cursor is on | |Clears the line the cursor is on | ||
|- | |- | ||
− | |[[term.getCursorPos()]] | + | |[[term.getCursorPos|term.getCursorPos()]] |
|Returns two arguments containing the x and the y position of the cursor. | |Returns two arguments containing the x and the y position of the cursor. | ||
|- | |- | ||
− | |[[Term.setCursorPos | + | |[[Term.setCursorPos|term.setCursorPos( x, y )]] |
|Sets the cursor's position. | |Sets the cursor's position. | ||
|- | |- | ||
− | |[[Term.setCursorBlink | + | |[[Term.setCursorBlink|term.setCursorBlink( b )]] |
|Disables the blinking or turns it on. | |Disables the blinking or turns it on. | ||
|- | |- | ||
− | |[[term.getSize()]] | + | |[[term.getSize|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]].) | |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|term.scroll( n )]] |
|Scrolls the terminal. | |Scrolls the terminal. | ||
|- | |- | ||
− | |[[ | + | |[[term.redirect|term.redirect( monitor )]] |
|Redirects terminal output to a monitor. | |Redirects terminal output to a monitor. | ||
|- | |- | ||
− | |[[term.restore()]] | + | |[[term.restore|term.restore()]] |
|Restores terminal output to the console. | |Restores terminal output to the console. | ||
|- | |- | ||
|} | |} | ||
[[Category:APIs]] | [[Category:APIs]] |
Revision as of 20:42, 7 July 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. |
term.redirect( monitor ) | Redirects terminal output to a monitor. |
term.restore() | Restores terminal output to the console. |