为了账号安全,请及时绑定邮箱和手机立即绑定

或者说,我想画两个不同颜色拼起来的半圆成为一个整圆怎么办?

或者说,我想画两个不同颜色拼起来的半圆成为一个整圆怎么办?

www说 2023-04-15 15:11:21
用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);*/
    };


查看完整回答
反对 回复 2023-04-18
  • 1 回答
  • 0 关注
  • 167 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信