WoW:API GetPlayerMapPosition: Difference between revisions
Jump to navigation
Jump to search
GetPlayerMapPosition -Documentation by Meog-
mNo edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
<center>'''GetPlayerMapPosition''' ''-Documentation by [[user:Meog|Meog]]-''</center> | <center>'''GetPlayerMapPosition''' ''-Documentation by [[user:Meog|Meog]]-''</center> | ||
Returns the postion of a unit on the current map | Returns the postion of a unit on the current map | ||
| Line 9: | Line 10: | ||
:("unit") | :("unit") | ||
:;unit : String - The [[API TYPE UnitId|UnitId]] for which the position is returned. ( | :;unit : String - The [[API TYPE UnitId|UnitId]] for which the position is returned. (Only works with <tt>player</tt> as unit type. This was to disable range-checking mods). | ||
---- | ---- | ||
Revision as of 07:41, 11 September 2005
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. (Only works with player as unit type. This was to disable range-checking mods).
- 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