Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Mugs on Mon 12/12/2005 02:46:55

Title: Objects: Fade In (SOLVED)
Post by: Mugs on Mon 12/12/2005 02:46:55
I know how to make an object fade out, but how do I make an objectÃ,  fade in ?Ã,  ???
Title: Re: Objects: Fade In
Post by: Gilbert on Mon 12/12/2005 03:07:08
You faded it out using transparency settings right? Just do the loop in reverse order then it'll fade in.

It'll be better if You post your script for the fade out part, so we can direct you in how to modify it to do the reverse.
Title: Re: Objects: Fade In
Post by: Mugs on Mon 12/12/2005 03:48:08
Sorry, I didn't think about the different methods of object fading, I used the object transparency function, as described below


int trans = object[0].Transparency;
while (trans < 100) {
Ã,  trans++;
Ã,  object[0].Transparency = trans;
Ã,  Wait(1);

}




Title: Re: Objects: Fade In
Post by: Gilbert on Mon 12/12/2005 03:54:21
Obvious changes:

int trans = 100;
while (trans >0 100) {
Ã,  trans--;
Ã,  object[0].Transparency = trans;
Ã,  Wait(1);

}





Quote
Title: Re: Objects: Fade In
Post by: Mugs on Mon 12/12/2005 04:20:31
What I think you meant was this:


int trans = 100;
while (trans > 0) {
Ã,  trans--;
Ã,  object[0].Transparency = trans;
Ã,  Wait(1);

}

(Removing the "100" in "while (trans >0 100) {" )

Your script seems to be working, but now there's another problem. When I enter the screen, the object is completely visible for half a second, then it becomes completely invisble, then after that, it starts fadding in. How do I fix that ?




Title: Re: Objects: Fade In
Post by: Gilbert on Mon 12/12/2005 04:24:22
Yeah I made a typo.
Just put the following line in "Player enters room (before fade-in)":

object[0].Transparency = 100;
Title: Re: Objects: Fade In
Post by: Mugs on Mon 12/12/2005 04:48:51
Thanks Gilbot V7000a, again :P.Ã, Ã,  I didn't think about the "before fade-in" thing.Ã,  Anyways, everything seems to be working, but... for how long?