// COMP1405/1005 - Day 08ish // example of mousePressed() function // mjh-2013 // declare variables int count = 0; String output1 = "The mouse was pressed "; String output2 = " many times."; // Initialize program void setup(){ size(600,400); background(222,222,0); fill(0); textSize(24); } // define what the mousePressed() function does void mousePressed(){ // when the mouse is pressed in a frame, // the code you add here will be executed. // this function is called either zero or one // time in each frame. (Never more than once.) count += 1; } // main body of program void draw(){ background(222,222,0); text(output1 + count + output2,25,height/2); }