Difference between revisions of "SetCursorPos"

From The Official Visionaire Studio: Adventure Game Engine Wiki
(Created page with "<b>History</b>: Available since <span style="color:green">v3.7</span> Sets position (absolute) of the mouse cursor to the x,y position provided! Syntax: <syntaxhighlight> se...")
 
Line 1: Line 1:
<b>History</b>: Available since <span style="color:green">v3.7</span>
+
<div class="toccolours mw-collapsible mw-collapsed" style="background: #f0f0f0; border: 1px dashed darkgrey" width="100%">
 +
<b>Command History</b>
 +
<div class="mw-collapsible-content">
 +
<div style="background:#ebebeb" width="100%">Available since <span style="color:orange">v3.7</span></div>
 +
</div></div>
 +
 
  
 
Sets position (absolute) of the mouse cursor to the x,y position provided!
 
Sets position (absolute) of the mouse cursor to the x,y position provided!
 +
  
 
Syntax:
 
Syntax:
Line 7: Line 13:
 
setCursorPos(pos)
 
setCursorPos(pos)
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
  
 
Example:
 
Example:
Line 19: Line 26:
 
setCursorPos({x=cPos.x,y=cPos.y})
 
setCursorPos({x=cPos.x,y=cPos.y})
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
  
  

Revision as of 18:42, 7 March 2013

Command History

Available since v3.7


Sets position (absolute) of the mouse cursor to the x,y position provided!


Syntax:

setCursorPos(pos)


Example:

-- let's set mouse cursor to 240 by 480!
setCursorPos({x=240,y=480})

-- you could of course use variables instead!
local cPos = {x=240,y=480}
setCursorPos(cPos)
-- or ...
setCursorPos({x=cPos.x,y=cPos.y})


Arguments

pos: integer (number)
The position where the mouse cursor should be be moved to! {x=int,y=int}

Flags: none

Return: none