So my code was working perfectly and then I added one more call into my draw method and now every time I run it a grey screen appears for about a second and then the program starts going.
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);
Basically I need to make a rectangle out of 250 lines, the first line will be white and the last will be black to make the effect of the gradient. but i only seem to get a black box.
can anyone help?
this should be really simple! please and thank you.