class Button { String buttonText; int moveMenu; float x = 0, y = 0; color buttonColor = 255; Button(String t, int m, color c) { buttonText = t; moveMenu = m; buttonColor = c; } Button(String t, color c) { buttonText = t; moveMenu = 100; buttonColor = c; } void display(float a, float b) { x = a; y = b; fill(buttonColor, 198); strokeWeight(3); rect(x, y, width*0.8, height*0.1); fill(0); text(buttonText, x, y); } void mouseReleased() { if (mouseX > width*0.1 && mouseX < width*0.9 && mouseY >= y-height*0.05 && mouseY <= y+height*0.05) { if (moveMenu == 100){ menu++; loop(); } else menu = moveMenu; } } }