Difference between revisions of "SetCursorPos"

From The Official Visionaire Studio: Adventure Game Engine Wiki
Line 1: Line 1:
<div class="toccolours mw-collapsible mw-collapsed tbl-ds">
+
==setCursorPos==
<span class="bold">Command History</span>
 
<div class="mw-collapsible-content">
 
<div class="alt-bg">Available since v?</div>
 
</div></div>
 
  
 +
<div class="command-min-version-info">Available since: <span class="command-min-version">v3.3</span></div>
  
Sets position (absolute) of the mouse cursor to the x,y position provided!
+
<div class="command-doc">Sets the absolute cursor position.</div>
  
 
+
Lua Syntax:
Syntax:
+
<pre class="command-syntax">setCursorPos(pos)</pre>
 +
===Arguments===
 +
====pos====
 +
:'''{x=int,y=int}''' - The position where the cursor will be set to.
 +
===Flags===
 +
===Return Values===
 +
None.
 +
===Examples===
 +
Example 1:  
 
<syntaxhighlight>
 
<syntaxhighlight>
setCursorPos(pos)
+
setCursorPos({x=240,y=480})
 
</syntaxhighlight>
 
</syntaxhighlight>
 
+
Example 2:  
 
 
Example:
 
 
<syntaxhighlight>
 
<syntaxhighlight>
-- 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}
 
local cPos = {x=240,y=480}
 
setCursorPos(cPos)
 
setCursorPos(cPos)
-- or ...
 
setCursorPos({x=cPos.x,y=cPos.y})
 
 
</syntaxhighlight>
 
</syntaxhighlight>
 
 
 
<span class="bold underline">Arguments</span>
 
 
<span class="bold">pos</span>: point (x,y) <br/>
 
The position where the mouse cursor should be be moved to! {x=int,y=int}
 
 
 
<span class="bold underline">Flags</span>
 
 
none
 
 
 
<span class="bold underline">Return</span>
 
 
none
 
{{i18n|SetCursorPos}} <br/>
 
{| style="background: #f0f0f0; border: 1px dashed darkgrey" width="100%"
 
|-
 
|<span class="bold">Relevant Pages</span>: [[GetCursorPos|getCursorPos]]
 
|}
 

Revision as of 18:12, 22 November 2013

setCursorPos

Available since: v3.3
Sets the absolute cursor position.

Lua Syntax:

setCursorPos(pos)

Arguments

pos

{x=int,y=int} - The position where the cursor will be set to.

Flags

Return Values

None.

Examples

Example 1:

setCursorPos({x=240,y=480})

Example 2:

local cPos = {x=240,y=480}
setCursorPos(cPos)