Forked from: shmdmoto's 四角形描画の形状指定方法サンプル diff:5 forked from: 四角形描画の形状指定方法サンプル ayame017 forked:0favorite:0lines:36license : MIT License modified : 2010-09-27 14:22:16 Embed Tweet // forked from shmdmoto's 四角形描画の形状指定方法サンプル package { import frocessing.display.F5MovieClip2D; /** * 四角形の四つの形状指定: * @author shmdmoto */ public class GraphicExample extends F5MovieClip2D { public function setup() : void { // ここに描画命令を記述します. drawGridGuide(); noFill(); // 初期設定の形状指定モード CORNER:左上角, 幅,高さ rectMode(CORNER); rect( 100, 100, 100, 100 ); // CORNERS: 左上角,右下角 rectMode(CORNERS); rect( 300, 100, 400, 200 ); // CENTER: 中心,幅,高さ rectMode(CENTER); rect( 100, 300, 100, 100 ); // RADIUS: 中心,半分の幅幅, 半分の高さ rectMode(RADIUS); rect( 300, 300, 100, 150 ); } // 位置をわかり安くするガイドを表示 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); ellipse(100,100,5,5); ellipse(300,100,5,5); ellipse(450,200,5,5); ellipse(100,300,5,5); ellipse(300,300,5,5); } } } Code Fullscreen Preview Fullscreen shohoku_col20100927 int