Difference between revisions of "Term.getCursorPos"

From ComputerCraft Wiki
Jump to: navigation, search
(localised)
 
(4 intermediate revisions by 4 users not shown)
Line 2: Line 2:
 
{{Function
 
{{Function
 
|name=term.getCursorPos
 
|name=term.getCursorPos
|args=none
+
|args=
 
|returns=x, y
 
|returns=x, y
 
|api=term
 
|api=term
Line 10: Line 10:
 
{{Example
 
{{Example
 
|desc=Prints the location of the cursor on screen.
 
|desc=Prints the location of the cursor on screen.
|code=print( term.getCursorPos() )
+
|code=local x, y = term.getCursorPos()<br />print(x .. ", " .. y)
 
}}
 
}}
 
}}
 
}}
 +
 +
[[Category:API_Functions]]

Latest revision as of 07:51, 23 January 2013


Grid Redstone.png  Function term.getCursorPos
Returns the location of the cursor on screen.
Syntax term.getCursorPos()
Returns x, y
Part of ComputerCraft
API term

Examples

Grid paper.png  Example
Prints the location of the cursor on screen.
Code
local x, y = term.getCursorPos()
print(x .. ", " .. y)