我想绘制一个带有黑色轮廓的大红色圆圈和一个没有轮廓的较小并发绿色圆圈。但是当我绘制绿色小圆圈时,它的线条样式与红色大圆圈相同。似乎没有任何类型的 endLineStyle 方法。将 lineStyle 粗细设置为 0 也不起作用。我意识到我还可以做很多其他事情,例如将它们绘制为单独的形状,或者使小绿色圆圈的 lineStyle 也为绿色,但我想知道是否有某种方法可以在不这样做的情况下摆脱 lineStyle。
var s:Shape = new Shape();
s.graphics.lineStyle(4,0x000000);
s.graphics.beginFill(0xff0000);
s.graphics.drawCircle(100,100,80);
s.graphics.endFill();
s.graphics.beginFill(0x00ff00);
s.graphics.drawCircle(100,100,40);
s.graphics.endFill();
addChild(s);
最佳答案
s.graphics.lineStyle();
第一个参数是厚度
,默认为null
。
厚度为零的调用 - s.graphics.lineStyle(0);
或 alpha
- s.graphics.lineStyle(1, 0, 0);
效果相同
关于actionscript-3 - AS3 : removing a lineStyle in the middle of drawing a shape,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37605523/