WoW:API GetCursorPosition: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(upgraded deprecated template)
(→‎Example: Ok, i need to l2preview)
Line 1: Line 1:
{{wowapi}}
{{wowapi}} __NOTOC__
<center>'''GetCursorPosition''' ''-Documentation by Kolth-''</center>


Returns the cursor's position on the screen.
Returns the cursor's position on the screen.


GetCursorPosition();
GetCursorPosition();
 
----
;''Arguments''


== Arguments ==
:''none''
:''none''


----
== Returns ==
;''Returns''


:;x : Number - The cursor's x-position on the screen.
:;x : Number - The cursor's x-position on the screen.
:;y : Number - The cursor's y-position on the screen.
:;y : Number - The cursor's y-position on the screen.


----
== Example ==
;''Example''
   local x, y = GetCursorPosition();
   local x, y = GetCursorPosition();


;''Result''
=== Result ===
  x = 956.24999166082;
  x = 956.24999166082;
  y = 538.49999965651;
  y = 538.49999965651;


----
== Details ==
;''Description''


: Returns scale-independant coordinates similar to Cursor:GetCenter() if 'Cursor' was a valid frame. You can use this value relative to UIParent if you treat BOTTOMLEFT as 0,0. Remember to also apply scale.
: Returns scale-independant coordinates similar to Cursor:GetCenter() if 'Cursor' was a valid frame. You can use this value relative to UIParent if you treat BOTTOMLEFT as 0,0. Remember to also apply scale.

Revision as of 12:14, 2 July 2007

WoW API < GetCursorPosition

Returns the cursor's position on the screen.

GetCursorPosition();

Arguments

none

Returns

x
Number - The cursor's x-position on the screen.
y
Number - The cursor's y-position on the screen.

Example

 local x, y = GetCursorPosition();

Result

x = 956.24999166082;
y = 538.49999965651;

Details

Returns scale-independant coordinates similar to Cursor:GetCenter() if 'Cursor' was a valid frame. You can use this value relative to UIParent if you treat BOTTOMLEFT as 0,0. Remember to also apply scale.