- Documentation
- Client functions
- getPlayerMapPositionFromWorld
Function
getPlayerMapPositionFromWorld
Converts a world point to a screen point on the open map. The map is slightly tilted, so the conversion accounts for perspective. The result can fall outside the visible rectangle; check it against getPlayerMapArea.
Syntax
float getPlayerMapPositionFromWorld(float x, float y)Arguments
xfloat- World X.
yfloat- World Y.
Returns
Screen x, y in pixels, or false when the map is closed.
Example
addEventHandler("onClientRender", root, function()
local sx, sy = getPlayerMapPositionFromWorld(1481, -1771)
if sx then dxDrawText("Ratusz", sx, sy) end
end)
See also
getWorldPositionFromPlayerMapConverts a screen point on the open map to a world point. It works the same as the coordinates fromonClientPlayerMapClick.getPlayerMapAreaReturns where the open map is on screen: the rectangle the terrain is drawn in. Useful for drawing your own markers and a frame around a map embedded withforcePlayerMap.