Thread Tools Display Modes
12-28-11, 08:51 PM   #1
Aanson
A Flamescale Wyrmkin
Join Date: Aug 2009
Posts: 124
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!!
__________________
__________________
  Reply With Quote
12-29-11, 03:46 AM   #2
Haleth
This Space For Rent
 
Haleth's Avatar
Featured
Join Date: Sep 2008
Posts: 1,173
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.

Last edited by Haleth : 12-29-11 at 03:50 AM.
  Reply With Quote
12-29-11, 08:47 PM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
If you need specific code suggestions, you should probably post your existing code, also.
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Making a panel fade after a 3 second delay

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off