WorldMap

Group
player
Methods
6
Fields
None

Getting one

client:getWorldMap()

Methods

MethodReturnsDescription
getWorldMapPosition()Point?The world tile at the centre of the map, or nil before the world map has been opened this session (the client has no world map yet).
getWorldMapZoom()numberThe zoom the map draws at, pixels per tile, or 0 before the world map has been opened this session.
setWorldMapPositionTarget(WorldPoint)()Scroll the map to worldPoint: when the map's current area contains the tile, it becomes the map's scroll target (x - regionLowX * 64, `…
worldPointToGraphicsPoint(WorldPoint)Point?The canvas point at the centre of worldPoint's tile on the open world map, or nil when the map is closed or its surface does not hold t…
getWorldMapData()WorldMapData?The surface of the map's current area, or nil before the world map has an area this session: the client loads one when the map is first o…
getWorldMapRenderer()WorldMapRenderer?The world map's renderer, or nil before the world map has loaded an area this session. Raises on a client whose table does not place its…

Returned by

MethodReturnsDescription
Client.getWorldMapWorldMapThe world map's view (whether or not it is open).

Method details

getWorldMapPosition

getWorldMapPosition: (WorldMap) -> Point?

The world tile at the centre of the map, or nil before the world map has been opened this session (the client has no world map yet).

getWorldMapZoom

getWorldMapZoom: (WorldMap) -> number

The zoom the map draws at, pixels per tile, or 0 before the world map has been opened this session.

setWorldMapPositionTarget

setWorldMapPositionTarget: (WorldMap, WorldPoint) -> ()

Scroll the map to worldPoint: when the map's current area contains the tile, it becomes the map's scroll target (x - regionLowX * 64, y - regionLowY * 64), and the client scrolls the map there over the next frames. Does nothing when the area does not contain the tile, or before the world map has an area (it was never opened this session); on the client thread only.

worldPointToGraphicsPoint

worldPointToGraphicsPoint: (WorldMap, WorldPoint) -> Point?

The canvas point at the centre of worldPoint's tile on the open world map, or nil when the map is closed or its surface does not hold the tile, by the client's own surface test (WorldMapData.surfaceContainsPosition, on the client thread; elsewhere the area's region bounds only).

getWorldMapData

getWorldMapData: (WorldMap) -> WorldMapData?

The surface of the map's current area, or nil before the world map has an area this session: the client loads one when the map is first opened.

getWorldMapRenderer

getWorldMapRenderer: (WorldMap) -> WorldMapRenderer?

The world map's renderer, or nil before the world map has loaded an area this session. Raises on a client whose table does not place its layout.