This site requires JavaScript, please enable it in your browser!
Back to discussions
Clem wrote ...


How to draw a Polygon ?

No_avatar Clem


Hi, first excuse my writing ( i'm French). This must be really easy but I'm not able to use the class drawPolygon because I just barely studied arrays at school, and only had 2 hours of greenfoot with the teacher. I tried to code this but it doesn't work (I filled the arrays before) : " i=0; while (i != nPoints) { Image.drawPolygon(xPoints , yPoints ,nPoints); i=i+1; } " Could anyone please give me an exemple of the method ?
Fractal_r3800c0s800f10000t0z80x0y0 danpost


Here is a method to draw the outline of a house:
You may need to set the drawing color of the image before drawing the polygon.
No_avatar_thumb Clem


The drawing works, thanks a lot !
You need to login to post a reply