//0:33, 2:40, 1:20, 273 PFont font; Loadbar mvmnt1,mvmnt2,mvmnt3; String performing = "performing.. . . . . ."; boolean dot = false; boolean theend = false; void setup(){ size (290, 148); frameRate(30); noSmooth(); font = loadFont("Bittr.vlw"); mvmnt1 = new Loadbar(33, 45, 90); mvmnt2 = new Loadbar(160, 45, 110); mvmnt3 = new Loadbar(80, 45, 130); } void draw(){ background(102); mvmnt1.go(); if(mvmnt1.done){ mvmnt2.go(); } if(mvmnt2.done){ mvmnt3.go(); } mvmnt2.waitbar(); mvmnt3.waitbar(); fill(255); text(performing, 47, 18, 210, 75); if (frameCount % 53 == 1 && !theend){ performing +=" ."; } if(mvmnt3.done && !theend){ performing +=" Finished"; theend = true; } } class Loadbar{ int duration; float incAmount; boolean done; int totalFrames; float current; int rectLength; int percent; float rx; float ry; float sx; float sy; float easing; Loadbar(int d, int x, int y){ duration = d; done = false; totalFrames = duration * 30; incAmount = 200.0/totalFrames; current = 0; rectLength = 200; percent = 0; rx = x; ry = y; sx = width; easing = .02; } void go(){ fill(255, 153, 0, 100); stroke(245); rect(sx, ry, current, 12); if(done){ rect(rx - 40, ry, 35, 12); fill(0); text("DONE", rx - 36, ry + 10); } fill(0,0); strokeWeight(1); rect(sx,ry,rectLength,12); rect(rx - 40, ry, 35, 12); fill(0); textFont(font); textSize(8); text(percent + " / " + duration , sx + 4, ry + 10); if(!done){ current+=incAmount; if(current >= rectLength){ done=true; } } percent = int((current / rectLength) * duration); float dx = rx - sx; if(abs(dx) > 1) { sx += dx * easing; } } void waitbar(){ stroke(245); fill(0,0); strokeWeight(1); rect(rx - 40, ry, 35, 12); } }