(adsbygoogle = window.adsbygoogle || []).push({});
Hi guys, basically i need to make a progress bar for my course like the one in the video below and i have got a little stuck because i seem to suck at this stuff :\
i have to use a program called processing site:You must login or register to view this content.
so far...
Originally posted by another user
int x = 0;
int y = 0;
int colour = 0;
//boolean move = false;
void setup() {
size (500, 300); //screen size to be 500 by 300
background (255); //background to be white
stroke (0); //black boarder
noFill(); //no fill
rect (120, 130, 260, 40); //rectangle to be drawn in center
textSize (24); //text size is 24
textAlign (CENTER); //text to be alligned in the center
//doing final text...doesnt print
String s;
fill (255); //white text
s = "100% Done";
smooth ();
text (s, width/2, 160); //position of text
}
void mouseClicked(){
void draw(){
//if (move) {
//doing progress bar
if (x < 250) {
stroke (0, colour);
line (125+x, 135, 125+x, 165);
delay (16); //one line is priniting every 16 milliseconds
colour++; //increasing greyscale
x++; //increasing length
//doing text in increments of 5 with a %...is overlapping
for (int i = 0; i < 100; i = i +5) {
fill (0); //text colour
text ( i + "%", width/2, 160); //placement of text
}