/* In this example, the canvas is painted with multiple lines going from the center of the canvas to the (moving) mouse position. Note well that background() is only called once, during setup. Any key press has the effect of clearing the canvas. */ // This function is executed only once, at the very beginning void setup() { size(500,400); background(255); } // This function is repeatedly call in an implicit loop. // A single call is responsible for drawing a single frame. void draw() { line(mouseX, mouseY, 0.5*width, 0.5*height); } void keyPressed() { background(255); }