Difference between revisions of "Term.setCursorPos"
From ComputerCraft Wiki
(Changing int to number) |
|||
Line 8: | Line 8: | ||
|desc=Sets the location of the cursor on screen. | |desc=Sets the location of the cursor on screen. | ||
|examples= | |examples= | ||
+ | |||
+ | Note that the x and y coordinates cannot be placed between lines. Floating point values (such as 1.5) will be rounded down to integers (like 1, in this case). | ||
+ | |||
===Basic usage=== | ===Basic usage=== | ||
{{Example | {{Example |
Latest revision as of 10:11, 13 September 2014
Function term.setCursorPos | |
Sets the location of the cursor on screen. | |
Syntax | term.setCursorPos(number x, number y) |
Returns | none |
Part of | ComputerCraft |
API | term |
Examples
Note that the x and y coordinates cannot be placed between lines. Floating point values (such as 1.5) will be rounded down to integers (like 1, in this case).
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 affect the new one
Example | |
Sets the location of the cursor to the start of the line. | |
Code |
oldx, oldy = term.getCursorPos() |