AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[function]Fade

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
ChalamiuS



Joined: 04 Jun 2006
Posts: 189

PostPosted: Mon Jan 07, 2008 8:36 pm    Post subject: [function]Fade Reply with quote

Just a fade function Rolling Eyes
Please note that this script have no effect on Win98/95 or NT4

The function Shocked

Code:

/*
Fade function by ChalamiuS with help from tic
Use:
Fade(WindowName,StartAlpha,EndAlpha,Sleep)
*/
Fade(Window, FromAlpha=255, ToAlpha=0, Sleep=5)
{
   Loop, % (FromAlpha > ToAlpha) ? (FromAlpha-ToAlpha)//5   : (ToAlpha-FromAlpha)//5 ;%
   {
      FromAlpha := (FromAlpha > ToAlpha) ? FromAlpha-5 : FromAlpha+5
      WinSet, Transparent, %FromAlpha%, %Window%
      Sleep %Sleep%
   }
}

_________________
IRC Mibbit


Last edited by ChalamiuS on Tue Nov 04, 2008 1:56 pm; edited 8 times in total
Back to top
View user's profile Send private message Visit poster's website
Elevator_Hazard



Joined: 28 Oct 2006
Posts: 302
Location: US

PostPosted: Tue Jan 08, 2008 2:54 am    Post subject: Reply with quote

Nifty, I'd hate to rain on your parade but... I think you can use the AnimateWindow dll to do those things, but maybe you can't use that dll on other windows...
_________________
Changed siggy at request of ahklerner Very Happy
Back to top
View user's profile Send private message
ChalamiuS



Joined: 04 Jun 2006
Posts: 189

PostPosted: Tue Jan 08, 2008 9:06 am    Post subject: Reply with quote

Does that one have a setable Sleeptime ? Surprised
Edit:
DOH it did Sad but I still like my own better Laughing
_________________
IRC Mibbit
Back to top
View user's profile Send private message Visit poster's website
majkinetor



Joined: 24 May 2006
Posts: 3652
Location: Belgrade

PostPosted: Tue Jan 08, 2008 10:44 am    Post subject: Reply with quote

There is very important difference between AnimateWindow and this.
AnimateWindow will stop the script while animation is active, while sleep in the loop of the above function will let the script interupt animation.
_________________
Back to top
View user's profile Send private message MSN Messenger
almex



Joined: 16 Oct 2007
Posts: 9

PostPosted: Tue Jan 08, 2008 6:45 pm    Post subject: Reply with quote

That's neat! Thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group