Difference between revisions of "Global Command: getCursorPos"
From The Official Visionaire Studio: Adventure Game Engine Wiki
(Created page with "<div class="toccolours mw-collapsible mw-collapsed tbl-ds"> <span class="bold">Command History</span> <div class="mw-collapsible-content"> <div class="alt-bg">Available since ...") |
|||
Line 47: | Line 47: | ||
{| class="tbl-ds" | {| class="tbl-ds" | ||
|- | |- | ||
− | |<span class="bold">Relevant Pages</span>: [[ | + | |<span class="bold">Relevant Pages</span>: [[SetCursorPos_(CMS)|setCursorPos]] |
|} | |} |
Revision as of 15:44, 21 February 2014
Command History
Available since v?
Stores the current position (absolute) of the mouse cursor into an x,y table, which can be used in a query to check if the current position is over an object/character or a certain part of the scene etc.
Syntax:
getCursorPos()
Example:
-- 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
Arguments
none
Flags
none
Return
pos
Table containing x,y values of current mouse cursor position
日本語 – 正體中文 – 한국어 – Dansk – Deutsch – English – Español – Français – Italiano – Nederlands – Polski – Português – Svenska – Русский |
Relevant Pages: setCursorPos |