その他図形描写②

by N.YUUKI forked from 折れ線を描く (diff: 38)
♥0 | Line 39 | Modified 2012-06-19 23:27:10 | MIT License
play

ActionScript3 source code

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

// forked from shmdmoto's 折れ線を描く
package 
{
    import frocessing.display.F5MovieClip2D;
    /**
     * 折れ線を描く
     * @author shmdmoto
     */
    public class GraphicExample extends F5MovieClip2D
    {
        public function setup() : void
        {
            
            fill(255,0,0);
            beginShape();
            vertex(100,100);
            vertex(150,100);
            vertex(150, 50);
            vertex(200, 50);
            vertex(200,150);
            vertex(100,150);
            endShape();
            
           
            fill(0,255,0);
            strokeWeight(6);
            beginShape();
            vertex(300,100);
            vertex(350,100);
            vertex(350, 50);
            vertex(400, 50);
            vertex(400,150);
            vertex(300,150);
            endShape();
            
            
            
            fill(0,0,255);
            strokeWeight(2);
            beginShape();
            vertex(300,250);
            vertex(350,250);
            vertex(350,200);
            vertex(400,200);
            vertex(400,300);
            vertex(300,300);
            endShape(CLOSE);
        }
        
    }
}