我正在使用 Spark:Path 在 Flex 中绘制路径。
我想从这条路径中减去一个圆形,如下图所示:
(小路又黑又宽)
有任何想法吗?
我尝试使用 Shape 对象创建蒙版,但无法完全创建具有圆孔的蒙版。
我正在使用 Spark:Path 在 Flex 中绘制路径。
我想从这条路径中减去一个圆形,如下图所示:
(小路又黑又宽)
有任何想法吗?
我尝试使用 Shape 对象创建蒙版,但无法完全创建具有圆孔的蒙版。
找到了。
不涉及口罩。
我拿起Path
并包裹了Group
它:
<s:Group blendMode="layer">
<s:Path id="connector" ... />
<s:Ellipse id="hole" blendMode="erase">
我将其设置为“图层”,并在使用 blendMode 的路径后blendMode
添加了一个椭圆erase
您不需要为此使用掩码,只需使用curveTo()
Graphics 类的方法:
var shape1:Shape = new Shape();
shape1.graphics.beginFill(0x000000);
shape1.graphics.moveTo(0,0);
shape1.graphics.lineTo(80,0);
shape1.graphics.curveTo(110,30,140,0);
shape1.graphics.lineTo(300,0);
shape1.graphics.lineTo(300,20);
shape1.graphics.lineTo(0,20);
shape1.graphics.lineTo(0,0);
shape1.graphics.endFill();
这给了你:
这显然不是使用您的确切尺寸,而是演示了原理。