ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   Highlight GUI elements when mouse over it (https://www.esoui.com/forums/showthread.php?t=7236)

Greenlander 07/22/17 07:09 AM

Highlight GUI elements when mouse over it
 
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 :D 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

votan 07/22/17 07:16 AM

Quote:

Originally Posted by Greenlander (Post 31964)
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 :D 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

Greenlander 07/22/17 07:25 AM

Aye exactly what I was searching for. Thanks a lot

Seems like I interpreted OnMouseEnter as mouse click event


All times are GMT -6. The time now is 08:26 AM.

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