From 2fc501961485a9f90431c5500ac4332f4b4ec44f Mon Sep 17 00:00:00 2001 From: Nickolay Grebenshikov Date: Tue, 20 Oct 2015 10:44:41 +0700 Subject: [PATCH 1/2] The ring samples added --- features/display/DrawingShapes/Source/Main.hx | 35 ++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/features/display/DrawingShapes/Source/Main.hx b/features/display/DrawingShapes/Source/Main.hx index 19796ca..c27fa27 100644 --- a/features/display/DrawingShapes/Source/Main.hx +++ b/features/display/DrawingShapes/Source/Main.hx @@ -1,6 +1,7 @@ package; +import flash.display.GraphicsPathCommand; import openfl.display.CapsStyle; import openfl.display.Graphics; import openfl.display.Sprite; @@ -113,7 +114,39 @@ class Main extends Sprite { curve.x = 20; curve.y = 340; addChild (curve); - + + var ring = new Sprite(); + ring.graphics.beginFill(0x24AFC4); + ring.graphics.drawRect (0, 0, 120, 100); + ring.graphics.drawRect (10, 10, 100, 80); + ring.graphics.endFill(); + ring.x = 20; + ring.y = 380; + addChild(ring); + + + var ringPath = new Sprite(); + ringPath.graphics.beginFill(0x24AFC4); + ringPath.graphics.drawPath( + flash.Vector.ofArray([ + GraphicsPathCommand.LINE_TO, + GraphicsPathCommand.LINE_TO, + GraphicsPathCommand.LINE_TO, + GraphicsPathCommand.LINE_TO, + GraphicsPathCommand.MOVE_TO, + GraphicsPathCommand.LINE_TO, + GraphicsPathCommand.LINE_TO, + GraphicsPathCommand.LINE_TO, + GraphicsPathCommand.LINE_TO + ]), flash.Vector.ofArray([ + 120.0, 0, 120, 100, 0, 100, 0, 0, + 10, 10, + 110, 10, 110, 90, 10, 90, 10, 10 + ])); + ringPath.graphics.endFill(); + ringPath.x = 160; + ringPath.y = 380; + addChild(ringPath); } From 923c693999083b6c9c324eb2c615079bdfc3d80e Mon Sep 17 00:00:00 2001 From: Nickolay Grebenshikov Date: Tue, 20 Oct 2015 15:19:07 +0700 Subject: [PATCH 2/2] The polyline sample added --- features/display/DrawingShapes/Source/Main.hx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/features/display/DrawingShapes/Source/Main.hx b/features/display/DrawingShapes/Source/Main.hx index c27fa27..b9f8f6a 100644 --- a/features/display/DrawingShapes/Source/Main.hx +++ b/features/display/DrawingShapes/Source/Main.hx @@ -147,6 +147,16 @@ class Main extends Sprite { ringPath.x = 160; ringPath.y = 380; addChild(ringPath); + + var polyline = new Sprite (); + polyline.graphics.lineStyle (10, 0x24AFC4); + polyline.graphics.moveTo(0, 50); + polyline.graphics.lineTo (150, 0); + polyline.graphics.lineTo (300, 50); + polyline.graphics.lineStyle(); + polyline.x = 300; + polyline.y = 380; + addChild (polyline); }