int circleX, circleY; // Position of circle button int intX, intY; int textX, textY; int circleSize = 55; // Diameter of circle color circleColor, baseColor; color circleHighlight; color currentColor; boolean circleOver = false; boolean released = false; String words; String a,b,c,d,e; String[] stringy = new String[5]; PImage bg; PFont font; void setup(){ size(679, 482); smooth(); circleColor = color(255); circleHighlight = color(204); baseColor = color(102); currentColor = baseColor; intX = 100; intY = 250; circleX = 98; circleY = 250; textX = 15; textY = 50; ellipseMode(CENTER); font = loadFont("OrangeKid-36.vlw"); bg = loadImage("controllerbg.jpg"); words = "WhatYA looking at? Leave me be."; stringy[0] = "WhatCHA lookin' at? Get outTA here!"; a = stringy[0]; stringy[1] = "WhatYA lookin' at? Get out of here!"; b = stringy[1]; stringy[2] = "WhatYA looking at? Leave me be."; c = stringy[2]; stringy[3] = "What are you lookin' at? Leave me be."; d = stringy[3]; stringy[4] = "Excuse me? Please leave me be."; e = stringy[4]; } void draw(){ background(bg); update(mouseX, mouseY); textFont(font, 36); fill(0); if(released = true){ text(words, textX, textY); } if(circleOver) { fill(#686c6c); } else { fill(#4c5252); } stroke(0); ellipse(circleX, circleY, circleSize, circleSize); } void update(int x, int y) { if(overCircle(circleX, circleY, circleSize) && mousePressed && mouseY < intY+20 && mouseY > intY-20) { circleOver = true; circleY = mouseY; } else { circleOver = false; } } void mousePressed(){ if(circleOver) { currentColor = circleColor; released = false; } } void mouseReleased(){ released = true; if(circleY >= 230 && circleY <= 238){ words = a; } if(circleY >= 239 && circleY <= 247){ words = b; } if(circleY >= 248 && circleY <= 253){ words = c; } if(circleY >= 254 && circleY <= 261){ words = d; } if(circleY >= 262 && circleY <= 270){ words = e; } circleX = intX; circleY = intY; } boolean overCircle(int x, int y, int diameter) { float disX = x - mouseX; float disY = y - mouseY; if(sqrt(sq(disX) + sq(disY)) < diameter/2 ) { return true; } else { return false; } }