Fandom

WoWWiki

API GetCursorPosition

104,634pages on
this wiki
Add New Page
Talk0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

WoW API < GetCursorPosition

Returns the cursor's position on the screen.

GetCursorPosition();

Arguments Edit

none

Returns Edit

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

Example Edit

 local x, y = GetCursorPosition();

Result Edit

x = 956.24999166082;
y = 538.49999965651;

Details Edit

Returns scale-independent 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.

Notes Edit

To apply scale, divide both x and y by the value returned by UIParent:GetEffectiveScale()
The coordinates returned by this use BOTTOMLEFT as the origin, not TOPLEFT. This means [0, 0] is the exact bottom-left point on the screen.

Also on Fandom

Random Wiki