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 & HelpSyntax Questions › frameCount question
Page Index Toggle Pages: 1
frameCount question (Read 688 times)
frameCount question
Aug 8th, 2005, 4:17am
 
I am just starting to learn Java and Processing by going through the examples.

Looking at "Vertices 3D" I am able to easily stop and restart the program with

void keyPressed(){
noLoop();
}

void mousePressed(){
loop();
}

so now I would like the program to go to frameCount 1 (thus the first frame of void draw() )

this is where I need guidance please.

basically I just want the drawing to be erased and start over when the mousePressed() input command is called.

thank you
Re: frameCount question
Reply #1 - Aug 8th, 2005, 5:15am
 
Perhaps you're not understanding processing's structure. You seem to be a flash programmer, referring to "going to a particular frame".

In processing, no frames are saved, unless you specifically ask it to. When you're drawing with processing, you're drawing to the pixel buffer called pixels[] which is a one dimensional  array containing your pixel data.

In such an environment, you can't really go back to a particular frame, unless you're re-drawing the entire state of the program.

To clear a screen is really easy, simply call background().

Page Index Toggle Pages: 1