0
,所以我想要做類似這樣的例子東西:創建在AS3方派口罩
http://www.flashandmath.com/howtos/circlefill/
除此之外,我想用一個方形而非圓形做到這一點。有沒有辦法與AS3做到這一點?谷歌搜索提供了很多關於創建一個圓形面具,但沒有關於尖銳的等價物!
,所以我想要做類似這樣的例子東西:創建在AS3方派口罩
http://www.flashandmath.com/howtos/circlefill/
除此之外,我想用一個方形而非圓形做到這一點。有沒有辦法與AS3做到這一點?谷歌搜索提供了很多關於創建一個圓形面具,但沒有關於尖銳的等價物!
您可以通過使用上面鏈接的示例輕鬆完成此操作。使用上面示例創建的圓,併爲其創建一個方形遮罩。
//this is your pie from the example linked above
//it could be a MovieClip or a Sprite, or possibly another type
//but we'll just call it a DisplayObject
var pieCircle:DisplayObject;
addChild(pieCircle);
//now create a square
var squareMask:Sprite = new Sprite();
//start drawing
squareMask.graphics.beginFill(0xff0000);
squareMask.graphics.drawRect(0, 0, pieCircle.width/2, pieCircle.height/2);
squareMask.graphics.endFill();
addChild(squareMask);
//now set the square as a mask of the pieCircle
pieCircle.mask = squareMask;
我會試試看看它是怎麼回事。謝謝。 – Eternalspirit