//// 080216b cr by rha on thales2 with P 0135 beta //// follow R&F handbook p. 212, mouse buttons // get some variables (dimensions of our angle) int h = 30; // button height int w = 40; // button width // setup the canvas void setup(){ size(400, 300); // do not want to change this later background(0); // black is nice for a movie/} frameRate(10); // slow // noLoop(); // sometimes useful print("talking"); } // draw something void draw(){ background(0); drawB(); // draw my button } // here is the button code void drawB(){ if ( mousePressed == true ) { fill(255, 0, 0); // red } else { background(128); // gray fill(0, 255, 0); // green } noStroke(); rect(200 - w/2, 150 - h/2, w, h); // our button } //// end