class Selection { MovieButton[] movs; Selection() { movs = new MovieButton[movies.length]; int posx = 80; int posy = 90; for(int i=0; i(90+25*16)) { posy = 90; posx += 230; } } } void go() { for(int i=0; i=x-d&&mouseX<=x+w+d&&mouseY>=y-d&&mouseY<=y+h+d) ? true : false; } void click() { m.readin(name+".srt"); background(255); drawers.restart(); timer.play.playing=true; timer.start(timer.speed); drawing = true; menu = false; } } class BackButton { int x,y; boolean over; int w,h,r; BackButton(int xx, int yy, int ww, int hh, int rr) { over = false; x = xx; y = yy; h = hh; w = ww; r = rr; } void draw() { pushMatrix(); translate(x,y); if(over) fill(20); else fill(30); noStroke(); beginShape(); smooth(); vertex(r,0); bezierVertex(r*2,0,w-r*2,0,w-r,0); bezierVertex(w,0,w,0,w,r); bezierVertex(w,2*r,w,h-2*r,w,h-r); bezierVertex(w,h,w,h,w-r,h); bezierVertex(w-r*2,h,r*2,h,r,h); bezierVertex(0,h,0,h,0,h-r); bezierVertex(0,h-r*2,0,2*r,0,r); bezierVertex(0,0,0,0,r,0); endShape(); pushMatrix(); translate(w/2,h/2); if(over) fill(255); else fill(200); beginShape(); vertex(0,4); vertex(-8,0); vertex(0,-4); endShape(); rect(0,-2,8,4); popMatrix(); noSmooth(); popMatrix(); } void check() { int d = 2; over = (mouseX>=x-d&&mouseX<=x+w+d&&mouseY>=y-d&&mouseY<=y+h+d) ? true : false; } void click() { drawing=false; menu = true; } } class PlayButton { int x,y; boolean playing; boolean theend; boolean over; int w,h,r; PlayButton(int xx, int yy, int ww, int hh, int rr) { playing = true; theend = false; over = false; x = xx; y = yy; h = hh; w = ww; r = rr; } void draw() { pushMatrix(); translate(x,y); if(over) fill(20); else fill(30); noStroke(); beginShape(); smooth(); vertex(r,0); bezierVertex(r*2,0,w-r*2,0,w-r,0); bezierVertex(w,0,w,0,w,r); bezierVertex(w,2*r,w,h-2*r,w,h-r); bezierVertex(w,h,w,h,w-r,h); bezierVertex(w-r*2,h,r*2,h,r,h); bezierVertex(0,h,0,h,0,h-r); bezierVertex(0,h-r*2,0,2*r,0,r); bezierVertex(0,0,0,0,r,0); endShape(); pushMatrix(); translate(w/2,h/2); if(over) fill(255); else fill(200); if(theend) { beginShape(); rect(-12,-10,8,20); vertex(12,10); vertex(-12,0); vertex(12,-10); endShape(); } else if(!playing) { beginShape(); vertex(-10,-10); vertex(15,0); vertex(-10,10); endShape(); } else { rect(-10,-10,8,20); rect(2,-10,8,20); } popMatrix(); noSmooth(); popMatrix(); } void check() { int d = 2; over = (mouseX>=x-d&&mouseX<=x+w+d&&mouseY>=y-d&&mouseY<=y+h+d) ? true : false; } void click() { if(!theend) { playing = (playing) ? false : true; } else { theend=false; drawing= true; playing = true; background(255); timer.start(timer.speed); drawers.restart(); } } } class hslider { float minvalue, maxvalue; int x, y, w, h; float currvalue; float multi; float currfloat; int currint; String name; color c_on = color(20); color c_off = color(70); boolean over; boolean drag; hslider(String n, int px, int py, float c, float mi, float ma, int ww, int hh) { minvalue = mi; maxvalue = ma; currvalue = c; w = ww; h = hh; x = px; y = py; name = n; reset(); } void reset() { over = false; drag = false; multi = (maxvalue-minvalue) / float(w); if(currvalue maxvalue) currvalue = maxvalue; //currint = (int) ( ( (float(currvalue)-float(minvalue)) / (float(maxvalue)-float(minvalue)) ) *w ); currint = int( (currvalue-minvalue)*w / (maxvalue-minvalue) ); } void draw() { textFont(lucida,10); pushMatrix(); translate(x,y); noStroke(); fill(155); text(name,10,-5); translate(0,6); fill(c_off); rect(0,0,w,h); fill(c_on); rect(0,0,currint,h); noFill(); stroke(255,10); for(int i=0; i<9; i++) line((i+1)*(w/10),0,(i+1)*(w/10),h-1); if(over) fill(255); else fill(200); rect(currint-3,-5,6,h+10); //translate(0,h+8); //fill(255); //text((int)currvalue,3,3); popMatrix(); } void check() { int d = 5; over = (mouseX>=x-d&&mouseX<=x+w+d&&mouseY>=y-d&&mouseY<=y+h+d) ? true : false; if(over && !drag && mousePressed) { drag = true; } if(drag) { currint = mouseX-x; if(currint>w) currint = w; else if(currint <0) currint = 0; currvalue = (minvalue + currint*multi); if(!mousePressed) { timer.speed = currvalue; drag = false; } } } }