【发布时间】:2019-06-13 19:27:56
【问题描述】:
我看到,为了绘制矩形路径,您可以使用类似于 here 的公式。
我想知道矩形路径是否有类似的东西?
编辑:我希望能够让一个点逐步绘制出整个矩形路径,而不是只显示整个矩形。
即
function redraw () {
//
Code for the animation, while keeping track of last point
(such that the end animation is continuous)
//
clearScreen();
ctx.beginPath();
ctx.rect(x,y,5,5);
ctx.stroke();
}
setInterval(redraw, 16);
redraw();
我也不想使用任何外部库
【问题讨论】:
标签: javascript html canvas