We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
using delay() (Read 633 times)
using delay()
Apr 15th, 2009, 6:11am
 
I know I'm being very silly, but I just can't get the delay() to work how I want it to.

Im using the fade hack in my sketch,
processing.org/hacks/doku.php?id=hacks:fading
and delaying it using delay(30); to give it a really nice slow fade. However, this is now making my entire programme run with a 30ms delay. Is there any way to JUST have the fade on delay, and everything else running normal speed?
Re: using delay()
Reply #1 - Apr 15th, 2009, 8:03am
 
In general, you don't use delay(), except in noDraw() mode (and perhaps threading, ...).
To slow down the effect, you can just count the frames (using frameCount of course) and draw the translucent rectangle every n frames (using % (modulo)).
Re: using delay()
Reply #2 - Apr 15th, 2009, 8:32pm
 
Mary, take a look at my example on this thread.
http://processing.org/discourse/yabb2/num_1239224859.html

Once your fade scene is complete, you want to turn off the delay.
Page Index Toggle Pages: 1