[英]EaselJS triangle with rounded corners?
How can I create a triangle with rounded corners in EaselJS? 如何在EaselJS中创建带有圆角的三角形? I'm using drawPolyStar to create the triangle, 我正在使用drawPolyStar创建三角形,
var polystar = new createjs.Shape();
polystar.graphics.drawPolyStar(100, 100, 60, 3, 0, -90);
This is an image of what I want the triangle to look like: 这是我希望三角形看起来像的图像:
EDIT: Image link doesn't seem to work. 编辑:图像链接似乎不起作用。 This is what the triangle should look like : 这是三角形的样子:
But actual triangle has sharp corners. 但是实际的三角形有尖角。
There are no canvas APIs for rounding corners of polygons that works like the roundRect API. 没有工作于roundRect API的用于圆角多边形的canvas API。
There are a few approaches I can think of: 我可以想到几种方法:
[EDIT] I spent a little time making a sample https://jsfiddle.net/lannymcnie/cga60tsf/1/ [编辑]我花了一些时间制作示例https://jsfiddle.net/lannymcnie/cga60tsf/1/
Sample 样品
// Line outer radius
context.lineJoin = "round";
context.lineWidth = cornerRadius;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.