View Single Post
08/10/15, 12:42 PM   #1
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,583
[outdated] Map Scale and Offset

Please add a function to the API that returns the position, scale and zone index of a map, relative to the Tamriel Map. The values should be in the same normalized coordinate space that is returned by all API functions.

Code:
(number)offsetX, (number)offsetY, (number)scaleX, (number)scaleY, (number)zoneIndex = GetCurrentMapMeasurements()
In LibGPS we try to emulate this by using the current player position and the PingMap function which sets a waypoint that is on the same position across all maps. This generally works, but it would be a lot simpler and make it much more stable if there was a nice API method that returned these infos that already should be known to the client anyways.

In addition please consider making g_mapPinManager and g_mapPanAndZoom in worldmap.lua globally accessible in order to avoid having to intercept them to modify pins or focus on a map position.

EDIT: Or just add the two methods that LibGPS is about:
Lua Code:
  1. localX, localY = GlobalToLocalPosition(globalX, globalY) -- takes a normalized position on the Tamriel map and returns the normalized position on the current map
  2. globalX, globalY = LocalToGlobalPosition(localX, localY) -- takes a normalized position on the current map and returns the normalized position on the Tamriel map
The position should also be allowed to be outside of [0, 1] because Coldharbour is outside of the Tamriel map.

Last edited by sirinsidiator : 08/10/15 at 12:52 PM.