Recent changes Random page
GAMING
Gaming
 
StarCraft Wiki
Super Smash Wiki
Halopedia
Diablo Wiki
FFXIclopedia
Grand Theft Wiki
See more...

GetCursorScaledPosition

From WoWWiki

Jump to: navigation, search
This is a user-defined function that you can copy and paste into your addon. Replace <PREFIX> with your addon's prefix to avoid conflicts between different versions of these functions.

Returns the scaled position of the cursor.

local x, y = GetCursorScaledPosition()

Function Parameters

Returns

x
The scaled x position of the cursor
y
The scaled y position of the cursor

Example

local x, y = GetCursorScaledPosition();
message('('..x..', '..y..')');

Result

(25.45218785412654, 375.45610597856123)

Code

local function GetCursorScaledPosition()
	local scale, x, y = UIParent:GetScale(), GetCursorPosition()
	return x / scale, y / scale
end
Rate this article:
Share this article:
.