void draw() { if(inRectangle(mouseX,mouseY,25,40,50,20)) // Inside rectangle, so make it yellow fill(255,255,0); else // Outside rectangle, so make it green fill(0,255,0); rect(25,40,50,20); } // check if the (mx,my) is in the rect(x,y,w,h) boolean inRectangle(int mx, int my, int x, int y, int w, int h) { return mx > x && mx < x+w && my > y && my < y+h; } // START NO NOTES // code used to capture screenshots void keyReleased() { if(key == '`' && !online) save("sketch.png"); }