Page 1 of 1

Fading

PostPosted: Tue May 11, 2010 10:30 pm
by GuybrushThreepwood
Is there any way to make an actor slowly fade in without using differently shaded sprites?

Re: Fading

PostPosted: Tue May 11, 2010 10:32 pm
by Hblade
Yeah :)

First, go to create actor - Script Editor
Code: Select all
transp = 1;


Now go to Draw Actor - Script Editor
Code: Select all
transp-=.02;


Please check out my videos here :D
viewtopic.php?f=1&t=8219

they can really help you :3

Re: Fading

PostPosted: Tue May 11, 2010 10:55 pm
by GuybrushThreepwood
cool thanks :mrgreen:

Re: Fading

PostPosted: Tue May 11, 2010 11:44 pm
by Hblade
Your welcome :D

Re: Fading

PostPosted: Wed May 12, 2010 4:38 pm
by linkshards
Oooo! What about fading transitions? Like the entire window/screen fades out and fades in black or white.

Re: Fading

PostPosted: Wed May 12, 2010 6:45 pm
by Hblade
Make an actor, a black actor the size of the screen or use canvas :D (Canvas tutorial in tutochao) use the erase function if canvas.

Re: Fading

PostPosted: Sat May 15, 2010 4:01 am
by linkshards
How exactly would I get it to fade?
I'm thinking a transparency increment over a certain amount of time?

Re: Fading

PostPosted: Sat May 15, 2010 1:53 pm
by Hblade
Yeah, but if your using Canvas, it'd be allot easier if you just used a double or a (real) variable to determine the transparency of the "erase" value. Call it c_trans for canvas trans
Code: Select all
erase(0, 0, 0, c_trans);

Now, at Create Actor, have this code:
Code: Select all
c_trans = 1;

Then of course, put the erase code in Draw Actor. Now, when an event is called, (In draw actor, use a variable to make the switch)
Code: Select all
c_trans-=.02;

Now it'll slowly fade out to black.

Re: Fading

PostPosted: Fri May 21, 2010 4:23 am
by linkshards
What about white?

Re: Fading

PostPosted: Fri May 21, 2010 6:44 pm
by MrJolteon
change the 0s in the erase code with 255

Re: Fading

PostPosted: Fri May 21, 2010 7:42 pm
by linkshards
Oh! Alright! lol I can't believe I didn't notice that it was an RGB scale. =w=

Re: Fading

PostPosted: Fri May 21, 2010 7:45 pm
by Hblade
lol