Fade in then out - i forgot

Talk about making games.

Fade in then out - i forgot

Postby DBGames » Sun Oct 25, 2009 9:27 pm

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;
User avatar
DBGames
 
Posts: 113
Joined: Wed Jun 24, 2009 10:13 am
Location: Bismarck, North Dakota
Score: 8 Give a positive score

Re: Fade in then out - i forgot

Postby DBGames » Sun Oct 25, 2009 9:30 pm

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:
User avatar
DBGames
 
Posts: 113
Joined: Wed Jun 24, 2009 10:13 am
Location: Bismarck, North Dakota
Score: 8 Give a positive score

Re: Fade in then out - i forgot

Postby makslane » Sun Oct 25, 2009 10:18 pm

Can you post the solution?
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Re: Fade in then out - i forgot

Postby DBGames » Sun Oct 25, 2009 10:30 pm

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
User avatar
DBGames
 
Posts: 113
Joined: Wed Jun 24, 2009 10:13 am
Location: Bismarck, North Dakota
Score: 8 Give a positive score

Re: Fade in then out - i forgot

Postby DST » Tue Oct 27, 2009 6:41 am

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;
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


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest