WoW:API GetPlayerMapPosition: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(Changed back the valid arguments)
m (Recategorized)
Line 30: Line 30:
----
----
{{Template:WoW API}}
{{Template:WoW API}}
[[Category:API World Map Functions|GetPlayerMapPosition]]

Revision as of 19:20, 28 December 2004

GetPlayerMapPosition -Documentation by Meog-

Returns the postion of a unit on the current map

posX, posY = GetPlayerMapPosition("unit");

Arguments
("unit")
unit
String - The UnitId for which the position is returned. (Verified for player, party*. Does not appear to work for pet (Tested with warlock), target and mouseover - removed by Blizzard.)

Returns
posX, posY
posX
Number - X value of the unit position (a proprotion between 0 and 1, relative to WorldMapDetailFrame)
posY
Number - Y value of the unit position (a proportion between 0 and 1, relative to WorldMapDetailFrame)

If both posX and posY are 0, then the position is unknown, unknowable, or not valid for the current map.


Example
local posX, posY = GetPlayerMapPosition("player");

Result
0.43320921063423, 0.69365233182907

Template:WoW API