Page 1 of 1

Fade in then out - i forgot

PostPosted: Sun Oct 25, 2009 9:27 pm
by DBGames
well i need an actor to fade in or out on mouse click
Not random !!
i need BOTH codes
all i can remember is in the draw actor of fading actor is
Code: Select all
transp-=0.02;

Re: Fade in then out - i forgot

PostPosted: Sun Oct 25, 2009 9:30 pm
by DBGames
Nevermind after a couple more coding attempts i got it
sorry- :?
how do you remove a post?
and i a common user cant could an administrator please do so... :oops:

Re: Fade in then out - i forgot

PostPosted: Sun Oct 25, 2009 10:18 pm
by makslane
Can you post the solution?

Re: Fade in then out - i forgot

PostPosted: Sun Oct 25, 2009 10:30 pm
by DBGames
sure,
In my example of failure, i had in the ( draw actor script editor ) event
Code: Select all
transp-=0.02;
transp+=0.02;


and disabled this event with a timer.

on mouse click up of another actor i had set to deystroy timer
and enable the Draw actor event.

sadly both thoughs code counter react each other so it never changed its transparency.

my solution was to create 2 more actors (Transparency_Hide) and (Transparency_Show)
removed all events to attempt to change transparency before
and in transparency hide draw actor
Code: Select all
Random_Actor.transp+=0.02;
(i stoped and started all events by deystroying timers and creating them again when needed)
In the Transparency Show Draw actor
Code: Select all
Random_Actor.transp-=0.02;
(i stoped and started all events by deystroying timers and creating them again when needed)

then using timers and mouse clicking to event enable a disable they worked on there own. is this explained enough? if not PM me or post your questions

Re: Fade in then out - i forgot

PostPosted: Tue Oct 27, 2009 6:41 am
by DST
Good thing mak asked you to post the solution! Here is a much simpler way:

actor>createactor>
Code: Select all
clickvar=0.02;


actor>mousebuttondown>
Code: Select all
clickvar*=-1;


actor>draw actor>
Code: Select all
transp+=clickvar;