bring to front?
in
Programming Questions
•
5 months ago
Hi!
I know that the last drawn objects are in front of the previous ones. but how do I put the rects in front of the stripes in this small program.
Im pretty new to processing so probably easy to solve
void setup() {
size(400, 200);
background(255);
for (int x = 0; x < 100; x++) {
stroke(random(255), random(255), random(255));
int h = x * 10;
line(h, 0, 0, h);
for (int y = 0; y < 5; y++) {
fill(random(255));
stroke(50);
int r = x * 20;
int v = y * 20;
rect(r, v, 20, 20);
}
}
}
I know that the last drawn objects are in front of the previous ones. but how do I put the rects in front of the stripes in this small program.
Im pretty new to processing so probably easy to solve
void setup() {
size(400, 200);
background(255);
for (int x = 0; x < 100; x++) {
stroke(random(255), random(255), random(255));
int h = x * 10;
line(h, 0, 0, h);
for (int y = 0; y < 5; y++) {
fill(random(255));
stroke(50);
int r = x * 20;
int v = y * 20;
rect(r, v, 20, 20);
}
}
}
1