void setup ( ) { size ( 600, 600 ); //-----change me } void draw ( ) { buttonPage ( ); } void buttonPage ( ) { background ( 50 ); //yellow button at center screen //old code only works if the size is 600 by 600 //the old mousePressed 'if' will make "Fooled you.".. //..appear when the button is pressed.. //..on a screen size of 600 by 600 //use the "println"s for finding the mouse positions rectMode ( CENTER ); fill ( 255, 255, 0 ); //-- rect ( 250, 265, 150, 50, 60 ); rect ( width / 2 + 20, height / 2 - 11, 150, 50, 60 ); textSize ( 20 ); fill ( 0 ); //-- text ( "Press Me", 280, 280 ); text ( "Press Me", width / 2 - 20, height / 2 - 19 ); textSize ( 10 ); //-- text ( "I'm a", 310, 292 ); text ( "I'm a", width / 2 + 9, height / 2 - 8 ); textSize ( 20 ); //-- text ( "Twinkie", 284, 310 ); text ( "Twinkie", width / 2 - 15, height / 2 + 10 ); //-- if ( mousePressed && mouseX < 400 && mouseX > 250 && mouseY < 320 && mouseY > 260 ) { //-- if ( mouseX < 595 && mouseX > 445 && mouseY < 320 && mouseY > 260 ) { if ( mouseX < width / 2 + 95 && mouseX > width / 2 - 55 && mouseY < height / 2 + 15 && mouseY > height / 2 - 38 ) { background ( 225 ); //-- text ( "Fooled you.", 260, 300 ); text ( "Fooled you.", width / 2 - 30, height / 2 ); } //-- println ( "mouseX" ); //-- println ( mouseX ); //-- println ( "mouseY" ); //-- println ( mouseY ); }