Core Function MouseGetPos
From Sputnik Wiki
				
				
				(Difference between revisions)
				
																
				
				
								
				 (Created page with "<pre> MouseGetPos ( ) </pre>  === Description ===  Retrieves the current position of the mouse cursor.  === Parameters ===  None  ==== clicks ====  Iptional; The number of times ...")  | 
		m (1 revision)  | 
		||
| (2 intermediate revisions by one user not shown) | |||
| Line 46: | Line 46: | ||
$y = MouseGetPos()[1];  | $y = MouseGetPos()[1];  | ||
println("X '" . $x . "' Y '" . $y . "'");  | println("X '" . $x . "' Y '" . $y . "'");  | ||
| − | + | ||
| + | // OR OR  | ||
| + | List ($x, $y) = MouseGetPos();  | ||
| + | println("X '" . $x . "' Y '" . $y . "'");  | ||
</syntaxhighlight>  | </syntaxhighlight>  | ||
[[Category:Core Function]]  | [[Category:Core Function]]  | ||
Latest revision as of 12:38, 14 June 2015
MouseGetPos ( )
Contents | 
Description
Retrieves the current position of the mouse cursor.
Parameters
None
clicks
Iptional; The number of times to move the wheel. Default is 1.
Return Value
Returns a two-element array that containing the mouse coordinates:
$array[0] = X coord (horizontal)
$array[1] = Y coord (vertical)
Remarks
See Opt(MouseCoordMode) for relative/absolute position settings. If relative positioning, numbers may be negative.
Example
$m = MouseGetPos(); println("X '$m[0]' Y '$m[1]'"); // OR $m = MouseGetPos(); $x = $m[0]; $y = $m[1]; println("X '" . $x . "' Y '" . $y . "'"); // OR EVEN $m = MouseGetPos(); $x = MouseGetPos()[0]; $y = MouseGetPos()[1]; println("X '" . $x . "' Y '" . $y . "'"); // OR OR List ($x, $y) = MouseGetPos(); println("X '" . $x . "' Y '" . $y . "'");