Tag Archives: drawCircle

draw

graphics.*で描ける矩形の描画テスト
まあ、見てもらえればわかるとおもいます。

ここでは、Shapeオブジェクトに描画して Stageに追加していますが
Spriteや、その他DisplayObjectにも描画できます。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package{
	import flash.display.*;
	import flash.events.*;
	[SWF(width="400", height="250")]
	public class ContextMenuClass extends Sprite{
		public function ContextMenuClass(){
			makeList();
		}
		private function makeList(){
			var shape:Shape = new Shape();
			this.addChild(shape);
			shape.x = 10;
			shape.y = 10;
			shape.graphics.lineStyle(4, 0x999999);
			shape.graphics.beginFill(0xCCCCCC);
			shape.graphics.drawCircle(50,50,50);
			shape.graphics.drawEllipse(110,0,170,100);
			shape.graphics.drawRect(0,110,110,100);
			shape.graphics.drawRoundRect(120,110,200,120,50,50);
		}
	}
}