DrawPoly
Monkey Forums/Monkey Programming/DrawPoly
| ||
Hi there are plans to add DrawPoly (filled) command to Monkey? I think it will be handy. |
| ||
This is the best I could do porting over some old code from the blitzmax forums. You can either draw a poly by passing a list of vertices, or by specifying a number of sides and a radius. If you try the latter method, you will see that I'm having issues with spacing between the triangles. Fun fun... example.monkey: drawpoly.monkey: |
| ||
Hi Thanks for your contribution, but I think a 'native' solution should be better: I've already changed mojo-html5 to handle DrawPoly, and I'm sure it could be done in all the other platforms. |
| ||
Yeah, I noticed you had done that shortly after posting :P I wasn't aware that it was so easy to 'hack' mojo like that. Following your example, I've fixed my triangle drawing problem by natively drawing them in each platform. I went with just triangles to reduce the amount of code required to triangulate the polygons properly in each platform, plus I really like warpy's triangulation method ;) If you or anyone else is interested, I can post all of my DrawTriangle() functions here, but, for the most part, all I did was copy and modify the DrawRect() functions to draw one tri instead of two. |
| ||
Well, the 'Monkey Code Section' is here to be filled! Each new hack/function is welcomed! (and maybe Mark could be impressed/interested/stimulated enough to port the changes as 'official' in mojo... |
| ||
Can you draw poly as lines only without fill? |
| ||
No. It shouldn't be too hard for you too implement. |
| ||
ok good to know. tnx |