forked from: 閉じた図形の描画属性の設定

by nan05aur forked from 閉じた図形の描画属性の設定 (diff: 40)
♥0 | Line 52 | Modified 2011-09-08 16:22:02 | MIT License
play

ActionScript3 source code

/**
 * Copyright nan05aur ( http://wonderfl.net/user/nan05aur )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/wE7H
 */

// forked from shmdmoto's 閉じた図形の描画属性の設定
package 
{
    import frocessing.display.F5MovieClip2D;
    /**
     * 円の輪郭・塗りの設定:
     * @author shmdmoto
     */
    public class GraphicExample extends F5MovieClip2D
    {
        public function setup() : void
        {
            // ここに描画命令を記述します.
            var x:Number = 200, y:Number = 20, w:Number = 50, h:Number = 100,
                v:int = 40;
                
            // 初期設定の描画属性
            strokeWeight(3);
            ellipse(100,100,90,90);
            // 赤での塗りつぶし
            fill(0,0,255);
            ellipse(100,200,90,90);
            // 線なし,緑で
            noStroke();
            fill(0, 0, 0);
            ellipse(100,300,90,90);
            // 青い線,塗りつぶしなし
            stroke(255,0,255);
            noFill();
            ellipse(100,350,90,90); 
            
            strokeWeight(1);
            stroke(0,0,0);
            fill(0,225,150);
            rect(x,y,w,h);
            x = x + w + 1;
            noFill();
            rect(x,y,w,h);
            x = x + w + 1;
            fill(255,0,0);
            rect(x,y,w,h);
            
            x = 200, y = 125, w = 50, h = 50;
            noStroke();
            rect(x,y,w,h);
            x = x + w;
            fill(255,255,0);
            rect(x,y,w,h);
            x = x + w;
            fill(0,255,0);
            rect(x,y,w,h);
            x = 200;
            y = y + h;
            fill(255,0,255);
            rect(x,y,w,h);
            x = x + w;
            fill(0,255,255);
            rect(x,y,w,h);
            x = 200;
            y = y + h;
            fill(0,0,255);
            rect(x,y,w,h);
        }
    }
}