Page 1 of 1

transp coding

PostPosted: Sat May 17, 2008 7:57 pm
by J Maker
hi im really rusty with game-editor because i've not bean using it for a long time and now because of my computer problems with my good computer, I don't have my codes to look back on until it's fixed so i was wondering:
how can i make something fade in and fade out right away with transp. I've done it before but since my computer is broken, I can't look at my codes :cry: :cry: :cry: :cry: and i had some awesome games. so anyway if anyone knows how please tell me. thx. :D

Re: transp coding

PostPosted: Sun May 18, 2008 1:05 am
by DST
i use a timer to do it, and a variable 'canfade'.

In draw actor,
Code: Select all
switch(canfade){
case 0:
transp -=.1;
break;
case 1:
transp +=.1;
break;
}


and on the timer,
Code: Select all
canfade=1;


The only thing you need to tweak there is the amount of transp change in draw actor and/or the length of the timer.

If you want it to fade in and out eternally, make timer repeat, and change to this:
Code: Select all
canfade=(transp > .99)? 0: 1;

Re: transp coding

PostPosted: Sun May 18, 2008 5:02 pm
by J Maker
thx i used to use a timer too it was something like this in the draw actor:
Code: Select all
if (canfade == 1)
{
     transp -= 0.wat/ev
     create timer wat ev
}
else if (canfade == 2)
{
     transp+= 0.wat/ev
}

then the timer:
Code: Select all
canfade = 2;

i just forgot how do u put the trasnp code in was i right with the:
transp -= 0.wat/ev

Re: transp coding

PostPosted: Sun May 18, 2008 8:20 pm
by J Maker
never mind i got it now thx for the help! :D