forked from: 線の幅・色を変える
forked from 線の幅・色を変える (diff: 46)
ActionScript3 source code
/**
* Copyright nan05aur ( http://wonderfl.net/user/nan05aur )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/eojg
*/
// forked from shmdmoto's 線の幅・色を変える
package
{
import frocessing.display.F5MovieClip2D;
/**
* Frocessingを使った線の描画属性設定
* @author shmdmoto
*/
public class GraphicExample extends F5MovieClip2D
{
public function draw() : void
{
// ここに描画命令を記述します.
var tx1:Number = 50,ty1:Number = 350,
tx2:Number = 150,ty2:Number = 350,
tx3:Number = 150,ty3:Number = 450;
var sx1:Number = 200,sy1:Number = 350,
sx2:Number = 300,sy2:Number = 350,
sx3:Number = 300,sy3:Number = 450,
sx4:Number = 200,sy4:Number = 450;
// 線幅の変更
line( 100, 25, 300, 25 );
strokeWeight(2);
line( 100, 50, 300, 50 );
strokeWeight(3);
line( 100, 75, 300, 75 );
// 線の色の変更
stroke(255,0,0);
line( 100,100, 300,100 );
stroke(0, 255, 0);
line( 100,125, 300,125 );
stroke(0, 0, 255);
line( 100,150, 300,150 );
// 元の設定に戻す
strokeWeight(5);
stroke(0,0,0);
line( 100,175, 300,175 );
strokeWeight(6);
line( 100,200, 300,200 );
strokeWeight(7);
line( 100,225, 300,225 );
// 線の色の変更
stroke( 0,255,255 );
line( 100,250, 300,250 );
stroke( 255, 0,255 );
line( 100,275, 300,275 );
stroke( 255,255, 0 );
line( 100,300, 300,300 );
strokeWeight(1);
stroke( 255, 0, 0 );
line( tx1,ty1, tx2,ty2 );
stroke( 0,255, 0 );
line( tx2,ty2, tx3,ty3 );
stroke( 0, 0,255 );
line( tx3,ty3, tx1,ty1 );
stroke( 0, 0, 0 );
line( sx1,sy1, sx2,sy2 );
strokeWeight(2);
line( sx2,sy2, sx3,sy3 );
strokeWeight(3);
line( sx3,sy3, sx4,sy4 );
strokeWeight(4);
line( sx4,sy4, sx1,sy1 );
}
}
}