/* line_drawing.pde Edited by Justin Hsia (orig. Larry Synder) Draws a line to mouse position when user presses mouse. */ // setup() is a function that runs once at beginning of program void setup() { size(500,500); // set drawing canvas size to 500x500 background(200,200,255); // sets background color to light blue } // draw() is a function that runs continuously over and over again void draw() { if(mousePressed) { // if user presses the mouse stroke(255, 255, 255); // set line color to white line(150, 150, mouseX, mouseY); // draw line from (150,150) to mouse position } }