Difference between revisions of "Term.getCursorPos"

From ComputerCraft Wiki
Jump to: navigation, search
(You mean "Destroyed page"?)
(Fixed broken example and removed "none" from args)
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=x, y = term.getCursorPos()<br />print(x .. ", " .. y)
 
}}
 
}}
 
}}
 
}}
  
 
[[Category:API_Functions]]
 
[[Category:API_Functions]]

Revision as of 07:50, 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
x, y = term.getCursorPos()
print(x .. ", " .. y)