Is there any way to query the x/y coordinates of the mouse cursor on the
screen at a certain time?
So far I have only found out how to test if the cursor is over a certain
frame but that is not what I need.
The background is the following:
I am trying to put together an addon that parses the tooltip to check if the
tooltip shows a "school of fish" (that part already works), then stores the
mouse cursor position in an array (don't know how to do that yet) and stores
it in an array and then keeps drawing a small red dot at all stored
positions.
The goal is to mark the extent of fish pools in red dots to compensate for
their "fading" animation which makes it very hard to see if the bobber
landed in the pool until its animation cycles again.
I fear that getting the cursor position is not possible to avoid excatly
such an addon, but am not sure...
Cheers
Urbin
--
Dun Morogh-EU (PvE)
Urbin (80), Dwarven Hunter | Surana (70), Draenei Mage
Mymule (80), Gnomish Warlock | Kordosch (65), Human Death Knight
Sunh (80), Nightelven Priest | Juran (33), Nightelven Druid
Getting the mouse position is easy, according to my giant lua manual:
local x,y = GetCursorPosition()
>I am trying to put together an addon that parses the tooltip to check if the
>tooltip shows a "school of fish" (that part already works), then stores the
>mouse cursor position in an array (don't know how to do that yet) and stores
>it in an array and then keeps drawing a small red dot at all stored
>positions.
I sort of lost interest in lua after developing a simple addon that I
needed for one of my raid jobs (selling flasks), but the book I used is
called, uninspiredly, "World of Warcraft programming". You hardly need
the book if you're just looking for a reference, you can go to
http://wowprogramming.com/docs
And dig through the various sections as needed. It's very handy.
>The goal is to mark the extent of fish pools in red dots to compensate for
>their "fading" animation which makes it very hard to see if the bobber
>landed in the pool until its animation cycles again.
It seems to me that would be a giant mess the moment you moved.
interpolating coordinates is not an easy thing to do in 3d space from a 2d
position on the window frame - it would be really tricky to keep the dots
pointing at the right thing, if not impossible because you don't have any
sense of the line-of-sight distance to the object under the cursor.
>I fear that getting the cursor position is not possible to avoid excatly
>such an addon, but am not sure...
It would be impossible to make many addons if you couldn't get the cursor
position. You can't always count on cursor events based on moving over a
control, especially if you want to subdivide the control. *
--
* PV Something like badgers, something like lizards, and something
like corkscrews.
Ah, thank you. I don't know how I could have missed this on wowwiki,
probably because I was searching for something with "mouse" in it instead of
"cursor" :-)
That does the trick nicely.
> >The goal is to mark the extent of fish pools in red dots to compensate for
> >their "fading" animation which makes it very hard to see if the bobber
> >landed in the pool until its animation cycles again.
>
> It seems to me that would be a giant mess the moment you moved.
Oh, absolutely. I intend this to only work while you stand still and don't
turn around. This constraint is usually a given while I fish, I don't move
at all, just cast and loot the bobber.
If you crank up the particle density in video effects, you should
always be able to see the edge of pools well enough.
---
Merlyn LeRoy