本文介绍了在Javascript中动态绘制SVG形状的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 您好, 我正在尝试制作类似于Moraware的CounterGo的程序,其中最好的功能之一就是只需在画布上拖动鼠标即可绘制多边形。 有没有办法在Javascript中重新创建这个?我尝试过SVG-Edit,但是有太多的工具,我想做一些更简单的东西,因为它应该非常快速和易于使用。 基本的想法是,当你点击时,多边形被绘制在鼠标后面,如果改变移动方向,它将以90度角跟随鼠标。 如果您有任何解决方案或建议,我们将不胜感激。 谢谢。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.推荐答案 这篇关于在Javascript中动态绘制SVG形状的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 09-05 14:35