用FLEX,確切的說是AS代碼。畫圓可以用下面這樣的代碼:graphics.clear();
var radius:Number = Math.min(this.width,this.height)/2;
graphics.beginFill(fillColor,fillAlpha); //填充顏色graphics.drawCircle(width/2,height/2,radius);
raphics.endFill();
1 回答

呼啦一陣風
TA貢獻1802條經驗 獲得超6個贊
graphics.beginFill(0xFF0000); halfCircle(graphics, 200,200, 100); // original circle function by senocular (www.senocular.com) from here http://www.actionscript.org/forums/showthread.php3?s=&threadid=30328 function halfCircle(g:Graphics, x:Number,y:Number,r:Number):void { var c1:Number=r * (Math.SQRT2 - 1); var c2:Number=r * Math.SQRT2 / 2; g.moveTo(x+r,y); g.curveTo(x+r,y+c1,x+c2,y+c2); g.curveTo(x+c1,y+r,x,y+r); g.curveTo(x-c1,y+r,x-c2,y+c2); g.curveTo(x-r,y+c1,x-r,y); // comment in for full circle /*g.curveTo(x-r,y-c1,x-c2,y-c2); g.curveTo(x-c1,y-r,x,y-r); g.curveTo(x+c1,y-r,x+c2,y-c2); g.curveTo(x+r,y-c1,x+r,y);*/ };
添加回答
舉報
0/150
提交
取消