Difference between revisions of "GetCursorPos"

From The Official Visionaire Studio: Adventure Game Engine Wiki
(Created page with "<b>History</b>: Available since <span style="color:green">v3.7</span> Stores the current position (absolute) of the mouse cursor into an x,y table which can be used in query ...")
 
(Redirected page to Global Command: getCursorPos)
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<b>History</b>: Available since <span style="color:green">v3.7</span>
+
#REDIRECT [[Global Command: getCursorPos]]
 
 
Stores the current position (absolute) of the mouse cursor into an x,y table which can be used in query to check if the current position is over an object/character or certain part of the scene etc.
 
 
 
Syntax:
 
<syntaxhighlight>
 
getCursorPos()
 
</syntaxhighlight>
 
 
 
Example:
 
<syntaxhighlight>
 
-- let's store the current position in a variable!
 
local variableName = getCursorPos()
 
 
 
-- let's check if the stored cursor position equals another x,y value!
 
if variableName.x == 200 and variableName.y == 400 then
 
-- do some action!
 
else
 
-- do some other action!
 
end
 
</syntaxhighlight>
 
 
 
<b><u>Arguments</u></b>
 
 
 
Flags: none
 
 
 
Return: Pos <br/>
 
Table containing x,y values of current mouse cursor position
 

Latest revision as of 13:24, 19 May 2023