What’s a Basic Sketch
Processing is based on Java. The creators of processing took the liberty of calling their simplified version of java code, a sketch. It fits in with their paradigm. A quick easy way to program.
Take Notice…
Notice the setup() and a draw() function?
The setup() is used to initiate variables and functions that need to be created before we start drawing.
The draw() function is constantly running. Any output code that gets executed here, will be drawn to the screen every frame.
Other things to Notice!
Do you see the text preceded by the double foward slashes?
It’s a comment. Basically, Anything typed after ‘//’
won’t get evaluated by the computer.
Example:
void setup() {
background(0); // A black background
size(640,480); // 640x480 canvas size
}
void draw() {
// any code inside the draw()
// will execute every frame
// ***Think of it as your canvas.
// What ever you put in here,
// everyone will see.
/*
This is a way to comment out multiple
Lines of code. Anything between the
slashes and asterik will not be evaluated
*/
}