Classes
WorldMap
Properties
markers
ts
markers: readonly WorldMapMarker[];
Gets list of World Map markers.
Note: this list is readonly, use addMarker
or removeMarker
to manage the World Map markers.
Methods
addMarker()
ts
addMarker(marker: WorldMapMarker | WorldMapMarkerPartial): WorldMapMarker
Adds a marker to the World Map.
Parameters
Parameter | Type | Description |
---|---|---|
marker | WorldMapMarker | WorldMapMarkerPartial |
Returns
Example
ts
const marker = worldMap.addMarker({ name: 'Here', x: player.x, y: player.y, color: 'green' });
goTo()
ts
goTo(coords: object): void
Changes the current location of the World Map, which also enables Free View.
Parameters
Parameter | Type | Description |
---|---|---|
coords | object | |
coords.x | number | - |
coords.y | number | - |
Example
ts
worldMap.goTo({ x: player.x, y: player.y });
parseLocation()
ts
parseLocation(input: string): undefined | object
Attempts to parse a location string and convert into map coordinates.
Note: Currently only supports Sextant coordinates, e.g. 100o25'S,40o04'E
Parameters
Parameter | Type | Description |
---|---|---|
input | string |
Returns
undefined
| object
Example
ts
const marker = worldMap.addMarker({
name: 'Sextant Loc',
color: 'green',
...worldMap.parseLocation("100o25'S,40o04'E")
});