三角形, 四角形の描画

by lenonsun forked from 三角形, 四角形を描く (diff: 12)
♥0 | Line 24 | Modified 2011-10-30 21:47:43 | MIT License
play

ActionScript3 source code

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

// 三角形, 四角形の描画
package 
{
    import frocessing.display.F5MovieClip2D;
    /**
     * 三角形,四角形の描画
     */
    public class GraphicExample extends F5MovieClip2D
    {
        public function setup() : void
        {
            drawGridGuide();
            triangle( 50, 75, 250, 35, 150, 250 );
            quad( 250, 250, 400, 200, 425, 375, 300, 350 );
        }
        // 以下は,位置をわかり安くする説明のため
        // 処理なので無視してください.
        public function drawGridGuide() : void
        {
            var x : int;
            var y : int;
            stroke(192,192,192);
            for( x = 0 ; x < 465 ; x += 50 ) 
                line( x, 0, x, 465);
            for( y = 0 ; y < 465 ; y += 50 ) 
                line( 0, y, 465, y);
            stroke(0,0,0);                     
        }
    }
}