WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   How would I add a POI on the map from world location? (https://www.wowinterface.com/forums/showthread.php?t=54588)

Joxip 10-02-16 03:22 PM

How would I add a POI on the map from world location?
 
Hello,

I'm wondering how I would go about adding a POI on the map from a world location. Any help would be greatly appreciated as I've been struggling for quite some time with this - thanks!

Edit: The only data I have access to is map, zone, area, x, y and z.

myrroddin 10-02-16 07:31 PM

Probably the easiest way would to be to use the HereBeDragons library. It does all the heavy lifting for you.

If you are just wanting to make your own notes, try HandyNotes, which uses HBD as a backend. And you can set waypoints using TomTom, also using HBD. You can find TomTom on both Wowinterface and Curse.

Joxip 10-05-16 06:23 AM

Quote:

Originally Posted by myrroddin (Post 319615)
Probably the easiest way would to be to use the HereBeDragons library. It does all the heavy lifting for you.

If you are just wanting to make your own notes, try HandyNotes, which uses HBD as a backend. And you can set waypoints using TomTom, also using HBD. You can find TomTom on both Wowinterface and Curse.

Have any idea on how it can be done without using a library? My project doesn't allow me.

Nimhfree 10-05-16 08:46 AM

Are you just trying to put an icon on the world map at a specific position? If so, you can do something like:

Code:

local frame = WorldMapDetailFrame
local pin = CreateFrame("Frame", nil, frame)
pin:SetWidth(16)
pin:SetHeight(16)
pin:EnableMouse(true)
pin:SetScript("OnEnter", function(pin) self:ShowTooltip(pin) end) -- this routine you need to write
pin:SetScript("OnLeave", function() self:HideTooltip() end) -- this routine you need to write
-- You need to set the texture of the pin you want to display.  Here is an example
pin.texture:SetTexture("Interface\\MINIMAP\\ObjectIcons.blp")
pin.texture:SetTexCoord(0.125, 0.250, 0.125, 0.250)
pin.texture:SetAllPoints()
-- Make it appear at different levels in the map as desired (other icons can cover it based on what you choose)
pin:SetFrameStrata("TOOLTIP")
pin:SetFrameLevel(frame:GetFrameLevel() + 1)
pin:SetPoint("CENTER", frame, "TOPLEFT", x / 100 * frame:GetWidth(), -y / 100 * frame:GetHeight())
pin:Show()

You will only want to do this if the map being shown matches that of the map associated with the x,y.

Torhal 10-05-16 11:15 AM

Quote:

Originally Posted by Joxip (Post 319691)
Have any idea on how it can be done without using a library? My project doesn't allow me.

Your project doesn't allow you? Care to elaborate?

Vlad 10-07-16 01:28 AM

There are a lot of map related quirks, and if you want a general solution, HBD would be the way to go.


All times are GMT -6. The time now is 07:16 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI