Ping minimap question
Since the function to ping the minimap uses it's own values instead of what GetPlayerMapPosition returns, I'm having trouble pinging the minimap at the location I would like to.
For instance I would like to ping 58,58 on the minimap, but Minimap:PingLocation() uses pixels from the minimaps center rather than coordinates. If anyone knows how to do this or can point me in the right direction I would appreciate it. |
Math is the answer.
You got your x and y coordinates from GetPlayerMapPosition("player") You got the wanted x and y position you wish to ping. Some math should help solve the issue! :D The important thing here is how PingLocation behaves, since the coordinates are pixel distances relative to the center of the minimap (positive coordinates are above or to the right of the center, negative are below or to the left), and not world coordinates! This means you need to account for the zoom levels, get the size of the map and calculate where your desired coordinates lie in the minimap scope of coordinates, then finally apply the ping animation. Working on the answer as I haven't done this particular formula before. By all means if someone else wishes to reply, do it! |
Yea I've been working on it most of this morning, I'm not very good at math when it comes to things like this but I'm still trying to figure it out in the mean time.
|
*Edit*
I just edited my reply. Here is what I found out, with Astrolabe this is a really easy thing to do, here is sample code: Code:
local icon = CreateFrame("Frame") http://svn.esamynn.org/astrolabe/trunk/ |
Thanks vlad, I appreciate all the help. ^.^
This does a lot more than what I was thinking it will be fun to mess around with it. :D |
All times are GMT -6. The time now is 07:50 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI