Wikia

WoWWiki

Watchlist Recent changes

GetCursorScaledPosition

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 Edit

Returns Edit

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

Example Edit

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

ResultEdit

(25.45218785412654, 375.45610597856123)

CodeEdit

local function GetCursorScaledPosition()
	local scale, x, y = UIParent:GetScale(), GetCursorPosition()
	return x / scale, y / scale
end

Pages on WoWWiki

94,193pages on
this wiki
Advertisement | Your ad here

Latest Photos

Add a Photo
55,622photos on this wiki
See more >

Recent Wiki Activity

See more >

Recent Questions

Around Wikia's network

Random Wiki