0
我這樣寫我的代碼,但是沒有以正確的方式出現。我不知道我錯過了什麼,我弄不明白。如果有人想要幫助!如何在AS3中繪製一顆星
private var _color:uint;
private var _radius:int;
public function Star(c:uint = 0xff0000, r:int = 15)
{
_color = c;
_radius = r;
createStar();
}
private function createStar():void
{
this.graphics.lineStyle(3,_color);
this.graphics.moveTo(_radius,0);
for(var i:int = 1; i < 11; i++)
{
var radius2:Number = _radius;
if (i % 2 > 0)
}
_radius = _radius/2;
var angle:Number = (6.28/5) * i;
this.graphics.lineTo(Math.cos(angle) * radius2, Math.sin(angle) * radius2);
}
}