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

2013/5/9

How to draw a Polygon ?

No_avatar Clem

2013/5/9

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

2013/5/9

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

2013/5/10

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