Difference between revisions of "Term.setCursorPos"
From ComputerCraft Wiki
(Created page with "{{lowercase}} {{Function |name=term.setCursorPos |args=int x, int y |returns=none |api=term |addon=ComputerCraft |desc=Sets the location of the cursor on screen. |exam...") |
|||
Line 16: | Line 16: | ||
{{Example | {{Example | ||
|desc=Sets the location of the cursor to the start of the line. | |desc=Sets the location of the cursor to the start of the line. | ||
− | |code=oldx, oldy = term.getCursorPos()<br />term.setCursorPos( | + | |code=oldx, oldy = term.getCursorPos()<br />term.setCursorPos(1,oldy) |
}} | }} | ||
}} | }} |
Revision as of 04:51, 6 July 2012
Function term.setCursorPos | |
Sets the location of the cursor on screen. | |
Syntax | term.setCursorPos(int x, int y) |
Returns | none |
Part of | ComputerCraft |
API | term |
Examples
Basic usage
Example | |
Sets the location of the cursor on screen to the top | |
Code |
term.setCursorPos(1,1) |
Using the old cursor position to effect the new one
Example | |
Sets the location of the cursor to the start of the line. | |
Code |
oldx, oldy = term.getCursorPos() |