forked from: Frocessing勉強中(ローディングのやつを作ってみる)
FrocessingWork2
24色がクルクルする練習。
@author Copyright (C) naoto koshikawa, All Rights Reserved.
/**
* Copyright hacker_tmbt9fl2 ( http://wonderfl.net/user/hacker_tmbt9fl2 )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/3e4r
*/
// forked from naoto5959's Frocessing勉強中(ローディングのやつを作ってみる)
package
{
import com.flashdynamix.utils.SWFProfiler;
import frocessing.display.*;
[SWF(width=465,height=465,backgroundColor=0x000000)]
/**
* FrocessingWork2
* 24色がクルクルする練習。
* @author Copyright (C) naoto koshikawa, All Rights Reserved.
*/
public class FrocessingWork2 extends F5MovieClip2D
{
private var t:Number = 0;
private var n:int = 24;
private var radius:Number = 15;
private var eachWidth:Number = 6;
private var eachHeight:Number = 2;
private var alphas:Array = [];
public function FrocessingWork2()
{
SWFProfiler.init(this);
colorMode(HSV, n, 1, 1);
noStroke();
makeAlphas();
}
private function makeAlphas():void
{
for (var i:int = 0; i <= n; i++)
{
alphas.push(i/n + 0.1);
}
}
public function draw():void
{
//
translate( 465 / 2, 465 / 2 );
for (var i:int = 0; i <= n; i++)
{
rotate(-Math.PI * 2 / n);
fill(i+t, 1, 1, alphas[(t+i) % n]);
rect(radius, 0, eachWidth, eachHeight, 1, 1);
}
if (++t == 24) t = 0;
}
}
}