actionscript-3 - AS3 : removing a lineStyle in the middle of drawing a shape

标签 actionscript-3 drawing shapes

我想绘制一个带有黑色轮廓的大红色圆圈和一个没有轮廓的较小并发绿色圆圈。但是当我绘制绿色小圆圈时,它的线条样式与红色大圆圈相同。似乎没有任何类型的 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/

相关文章:

matlab - 连接不连续的骨架形状和不连续的线条

actionscript-3 - 与 Erlang 服务器的 Flash 通信

actionscript-3 - AS3 : Rotation into Vector

actionscript-3 - AS3 Sound.Play(starttime)奇怪的延迟

java - 如何将PNG图像绘制到JPanel上?

c# - 在没有表格的情况下在屏幕上绘图

Java - 绘制线宽为1的放大形状

android - 我想在 android 中使用带有形状的选择器项选择一个按钮

actionscript-3 - AS3 - 如何在非垂直或水平的线上拖动对象

iphone - 当应用程序进入前台时丢失所有绘图