transp coding

Game Editor comments and discussion.

transp coding

Postby J Maker » Sat May 17, 2008 7:57 pm

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
Some people believe Chuck Norris evolved from a dinosaur, the Chucknorisaurus.
----------------------------------------------------------------------------------
Chuck Norris doesn't sleep, he waits.
----------------------------------------------------------------------------------
Chuck Norris doesn't hunt, he kills.
----------------------------------------------------------------------------------
Chuck Norris once shot down a german fighter plane with his finger by yelling BANG!!!
----------------------------------------------------------------------------------
User avatar
J Maker
 
Posts: 177
Joined: Fri Jun 22, 2007 4:17 pm
Location: in the stick version of Hyrule
Score: 10 Give a positive score

Re: transp coding

Postby DST » Sun May 18, 2008 1:05 am

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;
It's easier to be clever than it is to be kind.
http://www.lostsynapse.com
http://www.dstgames.com
User avatar
DST
 
Posts: 1117
Joined: Sun Apr 15, 2007 5:36 pm
Location: 20 minutes into the future
Score: 151 Give a positive score

Re: transp coding

Postby J Maker » Sun May 18, 2008 5:02 pm

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
Some people believe Chuck Norris evolved from a dinosaur, the Chucknorisaurus.
----------------------------------------------------------------------------------
Chuck Norris doesn't sleep, he waits.
----------------------------------------------------------------------------------
Chuck Norris doesn't hunt, he kills.
----------------------------------------------------------------------------------
Chuck Norris once shot down a german fighter plane with his finger by yelling BANG!!!
----------------------------------------------------------------------------------
User avatar
J Maker
 
Posts: 177
Joined: Fri Jun 22, 2007 4:17 pm
Location: in the stick version of Hyrule
Score: 10 Give a positive score

Re: transp coding

Postby J Maker » Sun May 18, 2008 8:20 pm

never mind i got it now thx for the help! :D
Some people believe Chuck Norris evolved from a dinosaur, the Chucknorisaurus.
----------------------------------------------------------------------------------
Chuck Norris doesn't sleep, he waits.
----------------------------------------------------------------------------------
Chuck Norris doesn't hunt, he kills.
----------------------------------------------------------------------------------
Chuck Norris once shot down a german fighter plane with his finger by yelling BANG!!!
----------------------------------------------------------------------------------
User avatar
J Maker
 
Posts: 177
Joined: Fri Jun 22, 2007 4:17 pm
Location: in the stick version of Hyrule
Score: 10 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron