Filling in DrawLine?

Hi, new to of…
I drew a shape with ofDrawLine and trying to fill it with solid color.

I tried ofFill(); but it doesn’t seem to work.

Is there another command for it?

Thanks in advance

ofDrawLine is just for drawing lines (which are not connected) – but if you want to draw a shape, you can use begin shape / end shape and add points (called vertices) to make a shape. you’d need at least 3 vertices to make a filled shape (2 would just be a line, which wouldn’t fill in…) – replace x,y, x2, y2, x3, y3 with your points:

ofVertex( x,y);
ofVertex( x2,y2);
ofVertex( x3,y3);

you can have as many vertices as you want, it will fill them in. you can check out the “polygonExample” which shows examples.