View Single Post
07/22/17, 07:16 AM   #2
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
Originally Posted by Greenlander View Post
Hey there,

I recently started scripting my first addon snippets 2 days ago but still not familiar with all the possibilities offered by the API. I used to develop a lot on Multi Theft Auto in case anyone knows, which is using a lua API aswell (and I have to say the documentation is a pain in the arse for beginners compared to MTA's since you on mta wiki you had for every function and event an example on how it could be used + all arguments explained and so so ^^)

So I'm currently working on some interface and was creating some drop down buttons and I wanted to highlight the choices on the dropdown menu when hovering your mouse over it without clicking any of them. But I can't find the right solution for detecting which GUI element I'm pointing on.

Anyone here to help me with a neat solution?

Regards,
Green
The controls have an OnMouseEnter/OnMouseExit event. I case you create them, you can listen to that event.

The sledgehammer method is to use the moc() function (MouseOverControl)
Lua Code:
  1. function moc()
  2.     return WINDOW_MANAGER:GetMouseOverControl()
  3. end
  Reply With Quote