2013-05-22 21 views

回答

0

您可以通過使用上面鏈接的示例輕鬆完成此操作。使用上面示例創建的圓,併爲其創建一個方形遮罩。

//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; 
+0

我會試試看看它是怎麼回事。謝謝。 – Eternalspirit