Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 使用动作脚本如何绘制不同颜色的一个圆';s_Actionscript 3 - Fatal编程技术网

Actionscript 3 使用动作脚本如何绘制不同颜色的一个圆';s

Actionscript 3 使用动作脚本如何绘制不同颜色的一个圆';s,actionscript-3,Actionscript 3,使用动作脚本如何绘制一个包含2或3种以上颜色的圆。如果圆被分成3部分,那么我将使用3种不同颜色绘制该圆。这意味着3个圆弧形成一个完整的圆 显示如何绘制圆弧绘制颜色区域,然后对其应用圆形遮罩: //draw two colored stripes var shape:Shape = new Shape(); var g:Graphics = shape.graphics; g.beginFill(0xFF0000); g.drawRect(0, 0, 100

使用动作脚本如何绘制一个包含2或3种以上颜色的圆。如果圆被分成3部分,那么我将使用3种不同颜色绘制该圆。这意味着3个圆弧形成一个完整的圆
显示如何绘制圆弧

绘制颜色区域,然后对其应用圆形遮罩:

    //draw two colored stripes
    var shape:Shape = new Shape();
    var g:Graphics = shape.graphics;
    g.beginFill(0xFF0000);
    g.drawRect(0, 0, 100, 50);
    g.endFill();
    g.beginFill(0xFFFF00);
    g.drawRect(0, 50, 100, 50);
    g.endFill();

    //create circle mask
    var mask:Shape = new Shape();
    g = mask.graphics;
    g.beginFill(0xFFFFFF);
    g.drawCircle(50, 50, 50);
    g.endFill();

    //now shape is two-colored circle
    shape.mask = mask;

我知道如何画一个圆..用opne颜色..我不知道如何画一个有不同颜色的圆..真的吗?