三角形の模様
forked from 三角形, 四角形を描く (diff: 14)
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/bOYD
*/
// 三角形の模様
package
{
import frocessing.display.F5MovieClip2D;
/**
* 三角形の模様
*/
public class GraphicExample extends F5MovieClip2D
{
public function setup() : void
{
drawGridGuide();
triangle( 100, 50, 250, 200, 100, 200 );
triangle( 250, 200, 250, 50, 400, 50 );
triangle( 250, 200, 400, 200, 400, 350 );
triangle( 250, 200, 250, 350, 100, 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);
}
}
}
