ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client functions
  3. getPlayerMapPositionFromWorld

Function

getPlayerMapPositionFromWorld

ClientPlayersTrilogy Hub only

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