API:GetZoneTransitionPoints
From RoR Wiki
UI Lua API · Map functions
Version: WAR 1.4.8
Returns the zone exits of the map currently shown in a map window.
points = GetZoneTransitionPoints(mapDisplayName)
Arguments
- mapDisplayName
string– Name of a MapDisplay window set up with CreateMapInstance.
Returns
- points
table– Array of transition points, indexed from 1. Nothing is returned if the window is not a known map window or its map has no transition data.
Each entry:
| Key | Type | Meaning |
|---|---|---|
x |
number |
Horizontal position on the map. The stock UI treats it as a value from 0 (west edge) to 65535 (east edge). |
y |
number |
Vertical position on the map, from 0 (north edge) to 65535 (south edge) in the stock UI. |
zone |
number |
Id of the zone the exit leads to. |
Details
- The data comes from the client's map data for the map the window is showing.
- If the client's map data is not loaded, the function returns nothing.
- Exactly one argument must be passed.
Errors
None besides the generic Invalid Parameters message when the argument is missing or not a string.
Example
From default/ea_worldmapwindow/source/zoneview.lua:
local mapDisplay = "EA_Window_WorldMapZoneViewMapDisplay"
local transitionPointData = GetZoneTransitionPoints( mapDisplay )
local mapDisplayWidth, mapDisplayHeight = WindowGetDimensions( mapDisplay )
for pointIndex, transitionPoint in ipairs(transitionPointData)
do
...
if (transitionPoint.x == 0) then
templateName = "ZoneTransitionPointWest"
anchorPoint = "topleft"
anchorX = -12
anchorY = (transitionPoint.y / 65535) * mapDisplayHeight
...
WindowSetId(transPointWindow, transitionPoint.zone)
end
