Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Pet Terry on Sun 20/06/2004 17:37:11

Title: Fading objects slower
Post by: Pet Terry on Sun 20/06/2004 17:37:11
Hello.

I'm using following script...

Quote
ObjectOn(0);
while (counter<100) {
SetObjectTransparency(0,100-counter);
Wait(1);
counter++;
}

...to fade an object. Now, I know that using counter+=2; for example will fade the object faster, but is there a way to make object fading slower?

Thanks.
Title: Re: Fading objects slower
Post by: Scorpiorus on Sun 20/06/2004 17:47:21
Yes, you can also adjust a value passed to the Wait() function:

ObjectOn(0);
while (counter<100) {
   SetObjectTransparency(0,100-counter);
   Wait(10); // will wait for ten times longer
   counter++;
}
Title: Re: Fading objects slower
Post by: Pet Terry on Sun 20/06/2004 19:30:27
Oh yes, that did the trick. Thanks!
Title: Re: Fading objects slower
Post by: TerranRich on Mon 21/06/2004 01:01:58
BFAQ'ed...n00b!!! :P

http://www.rain-day.com/harbinger/faq/#coding11