Astrolabe/API PlaceIconOnWorldMap

From Esamynn's Wiki

Jump to: navigation, search

Astrolabe ยป Astrolabe/API PlaceIconOnWorldMap

Places the provided icon on the specified world map frame using the provided World Map Point.

Please note that this function does not provide a management system for icons. It does simple, one time placement. It is up to the user to make sure the display is up-to-date when the map zoom changes.

xPos, yPos = Astrolabe:PlaceIconOnWorldMap( worldMapFrame, icon, continent, zone, xPos, yPos )

Arguments

worldMapFrame
UI Widget - the world map frame to which icon will be anchored (can be any anchorable Widget)
icon
UI Widget - the icon to be positioned (can be any anchorable Widget)
continent, zone, xPos, yPos
World Map Point - the position to use when calculating the icon's position

Returns

xDelta
Number - the calculated horizontal coordinates of the icon for the current World Map Zoom
yDelta
Number - the calculated vertical coordinates of the icon for the current World Map Zoom

Details

If the provided World Map Point does not match the current World Map Zoom, then this function will attempt to translate the provided point into the current World Map Zoom's coordinate system.

If the provided point falls within the bounds of the map for the current World Map Zoom then the icon will be re-anchored and :Show() will be called on it. Otherwise no anchoring will be done and :Hide() will be called on the icon.

Note that this function does call icon:ClearAllPoints(), before anchoring the icon.

This function returns nil for all arguments (and does not alter the icon's anchors) if it is not possible to translate the provided World Map Point into a meaningful position in the current World Map Zoom.

Personal tools