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