TransformSample
see http://gihyo.jp/design/feature/01/frocessing/0002
/**
* Copyright nutsu ( http://wonderfl.net/user/nutsu )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/62zk
*/
// see http://gihyo.jp/design/feature/01/frocessing/0002
package
{
import frocessing.display.F5MovieClip2D;
[SWF(width=465,height=465,backgroundColor=0x000000)]
public class TransformSample extends F5MovieClip2D
{
public function TransformSample()
{
var n:int = 30;
var r:Number = 2*Math.PI/n;
//HSVで色指定
colorMode( HSV, n, 1, 1 );
//矩形座標を中心に設定
rectMode( CENTER );
//キャンバスをステージの中心へ移動
translate( 465/2, 465/2 );
noStroke();
for ( var i:int = 0; i < n; i++ ) {
//キャンバスを角度r回転
rotate( r );
//塗り指定
fill( i, 1, 1 );
//矩形描画
rect( 150, 0, 36, 10, 4, 4 );
}
}
}
}