Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,
I am trying to make a program similar to Moraware's CounterGo, and one of the best features in it is the way you can draw a polygon by simply dragging the mouse around a canvas.

Is there a way to recreate this in Javascript? I have tried SVG-Edit, but there are too many tools, and I want to make something simpler, as it is supposed to be very quick and easy to use.

The basic idea is that when you click, the polygon is drawn behind the mouse, and will follow the mouse at 90 degree angles if you change the direction of movement.

If you have any solutions or suggestions, it would be appreciated.
Thanks.
Posted

1 solution

If SVG-Edit is too much for you, it's possible that you want too much. :-)
Well, you can try also this: http://svgkit.sourceforge.net[^].

(But, generally, it's hard to find what you want, because — who would do it for you? It's clear that you can just take SVG standard and Javascript and start creating some behaviors starting from first principles, or use some more or less comprehensive framework/library, but you want something in the middle. People may not be so interested in getting in the middle and giving you some basic results. Perhaps you have to be less picky and try to put more effort in what's available. My experience shows: if one wants "something simpler", later on it becomes "one more little thing", ad infinitum, often going nowhere. But it is motivated by your desire to get to the root of things, I greatly appreciate it.)
—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900