MButton cr = new MButton(740,100,50,50,255,0,0,""); MButton cg = new MButton(740,200,50,50,0,255,0,""); MButton cb = new MButton(740,300,50,50,0,0,255,""); MButton[] colorbuttons = {cr,cg,cb}; MButton resetb = new MButton(650,50,75,30,200,0,100,"Re-start"); MButton clearb = new MButton(740,50,50,30,200,0,100,"Clear"); PFont myfont; float[] a1 = new float[2]; float[] a2 = new float[2]; float[] c1 = new float[2]; float[] c2 = new float[2]; String[] msgs = new String[4]; int turn =0; int strcol = 0; int stgcol = 255; int stbcol = 0; void setup() { size(800,600); background(255); myfont = createFont("Ariel",18); msgs[0] ="Set anchor 1"; msgs[3] = "Set anchor 2"; msgs[1] = "Set control 1"; msgs[2] = "Set control 2"; frameRate(6); } void draw() { textFont(myfont); fill(0); text(msgs[turn],10,50); drawbuttons(); } void drawbuttons() { fill(0); textFont(myfont); text("Click mouse to set anchor and control points for continuous Bezier curve.",50,20); for (int i=0;i=xpos)&&(x<=(xpos+xlen))&&(y>=ypos)&&(y<=(ypos+ylen))) return true; else return false; } }