Line not drawing properly
in
Programming Questions
•
2 years ago
Hi everyone,
I'm relatively new to processing. I'm sure I am missing something basic. I understand the ordering in which shapes are drawn(i.e last drawn is on top etc). Does this apply to Lines aswell?
I'm trying to draw a very simple image of a line from the top corner to the opposite bottom corner. But the line either draws behind my ellipses or not at all.
With the "line(0,0,200,200);" outside my IF statement it draws, but is still behind the ellipse even though it is drawn after. Inside my IF statement it doesn't draw at all, but the smaller ellipses do.
Oh and there are definitely Pairs within my 'pairs' vector.
Any help would be appreciated.
- public void draw(){
- fill(col.getRGB());
- ellipse(40,40,50,50);
- fill(col2.getRGB());
- ellipse(120,120,50,50);
- // line(0,0,200,200);
- if(true){
- fill(0);
- // Pair = x & y coordinate
- for(Pair p : pairs){
- ellipse(p.x,p.y,5,5);
- strokeWeight(10);
- line(0,0,200,200);
- strokeWeight(1);
- }
- }
- }
1