Difference between revisions of "Term (API)"
From ComputerCraft Wiki
(added color functions) |
Shnupbups100 (Talk | contribs) |
||
Line 35: | Line 35: | ||
|- | |- | ||
|[[term.setTextColor|term.setTextColor]]([[Colors#Colors|color]]) | |[[term.setTextColor|term.setTextColor]]([[Colors#Colors|color]]) | ||
− | |Sets the terminal's foreground color. '''Note:''' only available on [[ | + | |Sets the terminal's foreground color. '''Note:''' only available on [[Advanced Computer|Advanced Computers]]. |
|- | |- | ||
|[[term.setBackgroundColor]]([[Colors#Colors|color]]) | |[[term.setBackgroundColor]]([[Colors#Colors|color]]) | ||
− | |Sets the terminal's background color. '''Note:''' only available on [[ | + | |Sets the terminal's background color. '''Note:''' only available on [[Advanced Computer|Advanced Computers]]. |
|- | |- | ||
|} | |} | ||
[[Category:APIs]] | [[Category:APIs]] |
Revision as of 06:32, 14 October 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. (Use peripheral.wrap to acquire a monitor "object".) |
term.restore() | Restores terminal output to the console. |
term.setTextColor(color) | Sets the terminal's foreground color. Note: only available on Advanced Computers. |
term.setBackgroundColor(color) | Sets the terminal's background color. Note: only available on Advanced Computers. |