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

Function

getPlayerMapArea

ClientPlayersTrilogy Hub only

Returns 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 with forcePlayerMap.

Syntax

float getPlayerMapArea()

Returns

x, y, width, height in pixels and true when the map is embedded in a rectangle; false when the map is closed.

Example

addEventHandler("onClientRender", root, function()
    local x, y, w, h = getPlayerMapArea()
    if x then
        dxDrawRectangle(x - 4, y - 4, w + 8, 4, tocolor(255, 200, 0))
    end
end)

See also