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.
IndexProgramming Questions & HelpPrograms › Looping in draw()
Page Index Toggle Pages: 1
Looping in draw() (Read 463 times)
Looping in draw()
Aug 21st, 2006, 9:14am
 
Hi,
I'm new to processing and am having a problem with loops.
I've got two nested for loops which are nested in a while loop in draw(). Within the core of these loops, theres some code which displays some graphics.
The problem is that when I run the program, the graphics are not displayed on the screen, though logically, the program is correct. When run without the while loop, everything works fine.
Please help me with this problem coz I'm not able to get any animation going because of this problem.

S.D
Re: Looping in draw()
Reply #1 - Aug 21st, 2006, 2:59pm
 
Things are only drawn when draw() finishes.

So if you want things to draw in order, you need to draw things in consecutive runs of draw();

draw() gets run every frame unless you have called noLoop(); when it only gets run once.
Re: Looping in draw()
Reply #2 - Aug 22nd, 2006, 6:47am
 
Thanks a million John! A little change in the program's logic and everything's working great! Smiley
Page Index Toggle Pages: 1