diff --git a/src/swf/exporters/AnimateLibraryExporter.hx b/src/swf/exporters/AnimateLibraryExporter.hx index 1a5e2ee..9e4e27f 100644 --- a/src/swf/exporters/AnimateLibraryExporter.hx +++ b/src/swf/exporters/AnimateLibraryExporter.hx @@ -613,6 +613,19 @@ class AnimateLibraryExporter ]); } + case LineGradientStyle(type, colors, alphas, ratios, matrix, spreadMethod, interpolationMethod, focalPointRatio): + commands = commands.concat([ + SWFShapeCommandType.LINE_GRADIENT_STYLE, + type, + colors, + alphas, + ratios, + serializeMatrix(matrix), + spreadMethod, + interpolationMethod, + focalPointRatio + ]); + case BeginFill(color, alpha): commands = commands.concat([SWFShapeCommandType.BEGIN_FILL, color, alpha]); @@ -992,6 +1005,19 @@ class AnimateLibraryExporter ]); } + case LineGradientStyle(type, colors, alphas, ratios, matrix, spreadMethod, interpolationMethod, focalPointRatio): + commands = commands.concat([ + SWFShapeCommandType.LINE_GRADIENT_STYLE, + type, + colors, + alphas, + ratios, + serializeMatrix(matrix), + spreadMethod, + interpolationMethod, + focalPointRatio + ]); + case BeginFill(color, alpha): commands = commands.concat([SWFShapeCommandType.BEGIN_FILL, color, alpha]); @@ -1541,6 +1567,7 @@ private #if (haxe_ver >= 4.0) enum #end abstract SWFShapeCommandType(Int) from I public var LINE_STYLE = 6; public var LINE_TO = 7; public var MOVE_TO = 8; + public var LINE_GRADIENT_STYLE = 9; } #if (haxe_ver < 4.0) @:enum #end diff --git a/src/swf/exporters/ShapeCommandExporter.hx b/src/swf/exporters/ShapeCommandExporter.hx index ff5129d..5dbe15f 100644 --- a/src/swf/exporters/ShapeCommandExporter.hx +++ b/src/swf/exporters/ShapeCommandExporter.hx @@ -69,6 +69,12 @@ class ShapeCommandExporter extends DefaultShapeExporter commands.push(LineStyle(thickness, color, alpha, pixelHinting, scaleMode, startCaps, /*endCaps,*/ joints, miterLimit)); } + override public function lineGradientStyle(type:GradientType, colors:Array, alphas:Array, ratios:Array, matrix:Matrix = null, + spreadMethod:SpreadMethod = null, interpolationMethod:InterpolationMethod = null, focalPointRatio:Float = 0):Void + { + commands.push(LineGradientStyle(type, colors, alphas, ratios, matrix, spreadMethod, interpolationMethod, focalPointRatio)); + } + override public function moveTo(x:Float, y:Float):Void { commands.push(MoveTo(x, y)); diff --git a/src/swf/exporters/animate/AnimateLibrary.hx b/src/swf/exporters/animate/AnimateLibrary.hx index 9aed6ed..eec92ad 100644 --- a/src/swf/exporters/animate/AnimateLibrary.hx +++ b/src/swf/exporters/animate/AnimateLibrary.hx @@ -662,6 +662,10 @@ import openfl.filters.GlowFilter; commands.push(LineStyle(data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], data[i + 6], data[i + 7], data[i + 8])); i += 9; + case LINE_GRADIENT_STYLE: + commands.push(LineGradientStyle(data[i + 1], data[i + 2], data[i + 3], data[i + 4], __parseMatrix(data[i + 5]), data[i + 6], + data[i + 7], data[i + 8])); + i += 9; case LINE_TO: commands.push(LineTo(__pixel(data[i + 1]), __pixel(data[i + 2]))); i += 3; @@ -719,6 +723,10 @@ import openfl.filters.GlowFilter; case LINE_STYLE: commands.push(LineStyle(data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], data[i + 6], data[i + 7], data[i + 8])); i += 9; + case LINE_GRADIENT_STYLE: + commands.push(LineGradientStyle(data[i + 1], data[i + 2], data[i + 3], data[i + 4], __parseMatrix(data[i + 5]), data[i + 6], + data[i + 7], data[i + 8])); + i += 9; case LINE_TO: commands.push(LineTo(__pixel(data[i + 1]), __pixel(data[i + 2]))); i += 3; @@ -819,6 +827,7 @@ import openfl.filters.GlowFilter; public var LINE_STYLE = 6; public var LINE_TO = 7; public var MOVE_TO = 8; + public var LINE_GRADIENT_STYLE = 9; } #if (haxe_ver >= 4.0) enum #else @:enum #end abstract SWFSymbolType(Int) from Int to Int diff --git a/src/swf/exporters/animate/AnimateShapeCommand.hx b/src/swf/exporters/animate/AnimateShapeCommand.hx index 7a708b0..d768c6b 100644 --- a/src/swf/exporters/animate/AnimateShapeCommand.hx +++ b/src/swf/exporters/animate/AnimateShapeCommand.hx @@ -19,6 +19,8 @@ enum AnimateShapeCommand EndFill; LineStyle(thickness:Null, color:Null, alpha:Null, pixelHinting:Null, scaleMode:Null /*LineScaleMode*/, caps:Null /*CapsStyle*/, joints:Null /*JointStyle*/, miterLimit:Null); + LineGradientStyle(fillType:Null /*GradientType*/, colors:Array, alphas:Array, ratios:Array, matrix:Matrix, + spreadMethod:Null /*SpreadMethod*/, interpolationMethod:Null /*InterpolationMethod*/, focalPointRatio:Float); LineTo(x:Float, y:Float); MoveTo(x:Float, y:Float); } diff --git a/src/swf/exporters/animate/AnimateShapeSymbol.hx b/src/swf/exporters/animate/AnimateShapeSymbol.hx index 7f2d1c9..3810522 100644 --- a/src/swf/exporters/animate/AnimateShapeSymbol.hx +++ b/src/swf/exporters/animate/AnimateShapeSymbol.hx @@ -83,6 +83,13 @@ class AnimateShapeSymbol extends AnimateSymbol graphics.lineStyle(); } + case LineGradientStyle(fillType, colors, alphas, ratios, matrix, spreadMethod, interpolationMethod, focalPointRatio): + #if flash + var colors:Array = cast colors; + #end + graphics.lineGradientStyle(GradientType.fromInt(fillType), colors, alphas, ratios, matrix, SpreadMethod.fromInt(spreadMethod), + InterpolationMethod.fromInt(interpolationMethod), focalPointRatio); + case LineTo(x, y): graphics.lineTo(x, y); diff --git a/src/swf/exporters/core/ShapeCommand.hx b/src/swf/exporters/core/ShapeCommand.hx index 923e3f8..9c8c4d8 100644 --- a/src/swf/exporters/core/ShapeCommand.hx +++ b/src/swf/exporters/core/ShapeCommand.hx @@ -25,6 +25,8 @@ enum ShapeCommand EndFill; LineStyle(thickness:Null, color:Null, alpha:Null, pixelHinting:Null, scaleMode:LineScaleMode, caps:CapsStyle, joints:JointStyle, miterLimit:Null); + LineGradientStyle(fillType:GradientType, colors:Array, alphas:Array, ratios:Array, matrix:Matrix, spreadMethod:SpreadMethod, + interpolationMethod:InterpolationMethod, focalPointRatio:Float); LineTo(x:Float, y:Float); MoveTo(x:Float, y:Float); } diff --git a/src/swf/exporters/swflite/ShapeSymbol.hx b/src/swf/exporters/swflite/ShapeSymbol.hx index 7064232..1cedcdb 100644 --- a/src/swf/exporters/swflite/ShapeSymbol.hx +++ b/src/swf/exporters/swflite/ShapeSymbol.hx @@ -83,6 +83,12 @@ class ShapeSymbol extends SWFSymbol graphics.lineStyle(); } + case LineGradientStyle(fillType, colors, alphas, ratios, matrix, spreadMethod, interpolationMethod, focalPointRatio): + #if flash + var colors:Array = cast colors; + #end + graphics.lineGradientStyle(fillType, colors, alphas, ratios, matrix, spreadMethod, interpolationMethod, focalPointRatio); + case LineTo(x, y): graphics.lineTo(x, y); diff --git a/src/swf/runtime/MorphShape.hx b/src/swf/runtime/MorphShape.hx index aab8d50..8cd4c0e 100644 --- a/src/swf/runtime/MorphShape.hx +++ b/src/swf/runtime/MorphShape.hx @@ -69,6 +69,12 @@ class MorphShape extends openfl.display.Shape graphics.lineStyle(); } + case LineGradientStyle(fillType, colors, alphas, ratios, matrix, spreadMethod, interpolationMethod, focalPointRatio): + #if flash + var colors:Array = cast colors; + #end + graphics.lineGradientStyle(fillType, colors, alphas, ratios, matrix, spreadMethod, interpolationMethod, focalPointRatio); + case LineTo(x, y): graphics.lineTo(x, y); diff --git a/src/swf/runtime/Shape.hx b/src/swf/runtime/Shape.hx index a8afa80..680f9a5 100644 --- a/src/swf/runtime/Shape.hx +++ b/src/swf/runtime/Shape.hx @@ -49,6 +49,12 @@ class Shape extends openfl.display.Shape graphics.lineStyle(); } + case LineGradientStyle(fillType, colors, alphas, ratios, matrix, spreadMethod, interpolationMethod, focalPointRatio): + #if flash + var colors:Array = cast colors; + #end + graphics.lineGradientStyle(fillType, colors, alphas, ratios, matrix, spreadMethod, interpolationMethod, focalPointRatio); + case LineTo(x, y): graphics.lineTo(x, y);