Difference between revisions of "GetCursorPos"
From The Official Visionaire Studio: Adventure Game Engine Wiki
Line 25: | Line 25: | ||
end | end | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | [[Category:Player Commands]] |
Revision as of 14:56, 26 November 2013
getCursorPos
Available since: v3.3
Returns the current absolute cursor position.
Lua Syntax:
getCursorPos()
Arguments
Flags
Return Values
- pos
- Table with x and y values containing cursor position.
Examples
Example 1:
-- let's store the current position into a variable
local curPos = getCursorPos()
-- let's check if the stored cursor position equals another x,y value
if curPos.x == 200 and curPos.y == 400 then
-- do some action
else
-- do some other action
end