Logic Error :S im sure i've tried everything!
in
Programming Questions
•
1 year ago
this code is supposed to make lots of lines appear to make a gradient.. it was working at one point but then i dont know what i did but it stopped working and for the life of me cant figure it out! ignore the useless variables.
please help! thank you
- int transp =0 ;
- boolean showgradientbar = true;
- int barW = width/2;
- int barH = 40;
- int topleftX = width/2-width/4;
- int topleftY = height/2 - 30;
- void draw(){
- }
- void drawgradientbar (){
- rectMode (CENTER);
- rect (width/2, height/2, 260, 50);
- if (showgradientbar == true) {
- for (int i=0; i<barW; i+=1) {
- transp +=1;
- stroke (0,0,0,transp);
- line (topleftX+i,topleftY,topleftX+i,topleftY+barH);
- }
- }
- }
- void setup (){
- size (500,300);
- background (255);
- drawgradientbar ();
- }
1