WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   General Authoring Discussion (https://www.wowinterface.com/forums/forumdisplay.php?f=20)
-   -   Making a panel fade after a 3 second delay (https://www.wowinterface.com/forums/showthread.php?t=42238)

Aanson 12-28-11 08:51 PM

Making a panel fade after a 3 second delay
 
Hey there!

I've created a dropdown menu for my UI using kgPanels.

Is there code I can use for the Parent panel to fade after a 3 second delay of non interaction?

Been trying to work this out myself for a while now and spent all night tonight trawling the forums to no avail!

Any help on this would be much appreciated!!

Haleth 12-29-11 03:46 AM

You could use an OnUpdate script which checks, say, every .05 seconds for GetMouseFocus() (or GetMouseFocus():GetParent(), depending on subframes). If the return value isn't your panel, then add the time since last update to a total. If it is, then the total is reset. If the total exceeds 3, stop the OnUpdate timer, reset the time since last update and total and hide the panel.

Also, perhaps easier, you can use the OnLeave function to start an OnUpdate script which counts to 3, and is cancelled only by OnEnter.

Phanx 12-29-11 08:47 PM

If you need specific code suggestions, you should probably post your existing code, also.


All times are GMT -6. The time now is 09:12 PM.

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