[AS]画圆,画椭圆的方法

      Flash学习 2004-11-13 14:46
//已知中心点坐标,水平半径rx,垂直半径ry,绘制椭圆
MovieClip.prototype.drawOval=function(x,y,rx,ry){
    this.moveTo(x+rx,y);
    this.curveTo(rx+x,0.4142*ry+y,0.7071*rx+x,0.7071*ry+y);
    this.curveTo(0.4142*rx+x,ry+y,x,ry+y);
    this.curveTo(-0.4142*rx+x,ry+y,-0.7071*rx+x,0.7071*ry+y);
    this.curveTo(-rx+x,0.4142*ry+y,-rx+x,y);
    this.curveTo(-rx+x,-0.4142*ry+y,-0.7071*rx+x,-0.7071*ry+y);
    this.curveTo(-0.4142*rx+x,-ry+y,x,-ry+y);
    this.curveTo(0.4142*rx+x,-ry+y,0.7071*rx+x,-0.7071*ry+y);
    this.curveTo(rx+x,-0.4142*ry+y,rx+x,y);
};
//已知坐标,半径,绘制一个圆
MovieClip.prototype.drawCircle=function(x,y,r){
    this.drawOval(x,y,r,r);
};
标签集:TAGS:
回复Comments() 点击Count()

回复Comments

{commentauthor}
{commentauthor}
{commenttime}
{commentnum}
{commentcontent}
作者:
{commentrecontent}