Lesson01 miyaoka forked:3 favorite:0 lines:21 license : MIT License modified : 2009-03-17 10:49:05 package { import flash.display.Graphics; import flash.display.Sprite; [SWF(width="465", height="465", backgroundColor= 0xffffff, frameRate="60")] public class Lesson01 extends Sprite { public function Lesson01() { //graphicsオブジェクトのメソッドを使って描画する //書くのがめんどいのでgという名前にする var g:Graphics = graphics; //-------------------------------------------- //円を描く //塗りの設定をする //色:0xFF0000 16進数で指定 //アルファ値:0.0で透明、1.0で不透明 g.beginFill(0xFF0000, 1.0); //x座標、y座標、半径の順 g.drawCircle(100, 200, 50); //-------------------------------------------- //四角を描く //色を変えてみる g.beginFill(0x00FF00, 1.0); //x座標、y座標、幅、高さ g.drawRect(200, 300, 100, 50); //-------------------------------------------- //線を描く //線を設定する //太さ、色、アルファ値 g.lineStyle(5, 0x0000FF, 0.5); //movetoでは描画せずに座標移動 g.moveTo(300, 200); //linetoで現在座標から設定座標に向かって線を引く g.lineTo(400, 300); } } } Code Fullscreen Preview Fullscreen graphics Sprite sort new page view favorite forked pv 327 forked from: Lesson01 hacker_lpw4me25 forked:0 favorite:0 lines:27 ( diff:25 ) pv 260 forked from: Lesson01 mickoh forked:0 favorite:0 lines:24 ( diff:9 ) pv 469 forked from: Lesson01 Achamo forked:0 favorite:0 lines:33 ( diff:43 )