Page 1 of 1

coding pro needed...

PostPosted: Fri Jun 26, 2009 11:58 am
by DBGames
hey dellzby here with a question..

could anyone tell me the code for a slow transparancy change. its change must be 100% but it must be noticable at the same time

thx in advanced i hope to post my completed game soon...

Re: coding pro needed...

PostPosted: Fri Jun 26, 2009 11:59 am
by MrJolteon
I tried making that myself, but it didn't work for me either.

Re: coding pro needed...

PostPosted: Fri Jun 26, 2009 2:22 pm
by DST
Code: Select all
transp+=.01;


Note to all: When images become transparent, they still render, and use up cpu!

If you want it to stop rendering, set
Visibility State to disable or don't draw/but allow events once the transp =1.

Re: coding pro needed...

PostPosted: Fri Jun 26, 2009 5:38 pm
by DBGames
DST i like your idea but im sure itll work the way needed.

i have TWO actors right in layers the only difference is the word on both actors. on mouse button UP for the only visible actor, it slowly becomes transparent showing the other actor. BUT after its 100% trans parent i want it to stay that way...

When you mouse button UP on the below actor i need the top actor to slowly transparent in. if you get is try your best but if you don't, then say and ill try my best at describing...

Re: coding pro needed...

PostPosted: Fri Jun 26, 2009 7:01 pm
by DST
Create a variable, real, actor integer. Here i named it 'fade'.

Actor>Createactor>
Code: Select all
fade=-.01;


Actor>mousebuttonup>
Code: Select all
fade*=-1;




Actor>Draw Actor>
Code: Select all
transp+=fade;
if(transp>.99){
VisibilityState("Event Actor", DONT_DRAW_ONLY);
EventDisable("Event Actor", EVENTMOUSEBUTTONUP);
}
else if(transp<=.99){
EventEnable("Event Actor", EVENTMOUSEBUTTONUP);
VisibilityState("Event Actor", ENABLE);
}



There's one way to do that. There are lots of ways to do it.

Re: coding pro needed...

PostPosted: Sat Jun 27, 2009 9:03 pm
by DBGames
wow thanks :D

Re: coding pro needed...

PostPosted: Mon Jun 29, 2009 8:41 am
by MrJolteon
I did something else to make one button disappear, and another one appear. DEMO:
G-E-P-A-I-N-T-E-R.zip
demo
(737.38 KiB) Downloaded 106 times