LibMapPins-1.0

CreatePinByMapID(icon, x, y, mapID[,mapFloor]

) Place an icon on the world map frame.

Parameters

icon
Path to icon file (string)
x
Horizontal XX.xx coordinate for the icon (number)
y
Vertical YY.yy coordinate for the icon (number)
mapID
The mapID (number)
mapFloor
The map floor, default 0 (number) optional

Return value

pin Shown on the world map, table of input values

Usage

-- Put an icon in Cleft of Shadow, Orgrimmar
local pin = MyAddOn:CreatePinByMapID(icon, 22.84, 13.56, 321, 1)


DeleteAllWorldPins()

Permanently delete all world map pins and labels.

Usage

MyAddOn:DeleteAllWorldPins()


DeleteWorldPin(pin)

Permanently delete both a pin and its label.

Parameters

pin
From CreatePinByMapID


DeleteWorldPinLabel(pin)

Permanently delete a pin's label.

Parameters

pin
From CreatePinByMapID


FindWorldIcon(icon)

Find all the locations of a given icon.

Parameters

icon
The icon you want all known locations found

Return value

locations A table of all locations of the icon

Usage

local icon = [[Interface/MINIMAP/TRACKING/Innkeeper.png]]
-- code here that adds innkeeper icons on various maps
local pinLocs = MyAddOn:FindWorldIcon(icon)
for mapName, pin in pairs(pinLocs) do
	 print("The icon "..icon.." can be found at "..mapName)
  print("The mapID is "..pin.mapID)
  print("The map floor number is "..pin.mapFloor)
  print("The X coordinate is "..pin.x)
  print("The Y coordinate is "..pin.y)
end


HideAllWorldPins()

Hide all world map pins and labels.

Usage

MyAddOn:HideAllWorldPins()


HideWorldPin(pin)

Hide world map pin and its label.
use ShowWorldPin() to reveal the pin again.

Parameters

pin
The world map pin


SetNewWorldPinIcon(pin, icon)

Set a new icon for a world pin.
You do not need to call this when creating a pin, instead calling it when you want to change an icon based on an Event firing, for example. This will automatically show the pin.

Parameters

pin
A world map pin
icon
Path to the new icon


SetWorldPinAlpha(pin, alpha)

Set a world pin's alpha.
Do not call :SetAlpha() directly because UI reloads will forget the setting.

Parameters

pin
The world pin to adjust
alpha
Number between 0 - 1


SetWorldPinHeight(pin, height)

Set a world pin's height.
Do not call :SetHeight() directly because UI reloads will forget the setting.

Parameters

pin
The world pin to adjust
height
Number in pixels


SetWorldPinLabel(pin, text)

Add a mouse over label to a specific world map pin.
The label will vanish when not mousing over the pin.

Parameters

pin
The pin from CreatePinByMapID
text
String displayed on mouse over


SetWorldPinScale(pin, scale)

Set a world pin's scale.
Do not call :SetScale() directly because UI reloads will forget the setting.

Parameters

pin
The world pin to adjust
scale
Number where 1 is the default 12 x 12 pixels


SetWorldPinWidth(pin, width)

Set a world pin's width.
Do not call :SetWidth() directly because UI reloads will forget the setting.

Parameters

pin
The world pin to adjust
width
Number in pixels


ShowAllWorldPins()

Show all world map pins and labels.

Usage

MyAddOn:ShowAllWorldPins()


ShowWorldPin(pin)

Show world map pin and its label.
Use HideWorldPin() to make it hide.

Parameters

pin
The world map pin


You must login to post a comment. Don't have an account? Register to get one!