OpenFL Graphics
class drawPath
is not compiling for Flash or html5 targets.
For targets such as mac, this functionality compiles and renders the correct result either as literal:
var g:Graphics = graphics;
g.drawPath([1, 2, 2, 2, 2], [20,10, 50,10, 50,40, 20,40, 20,10]);
Or, as typed collections:
var g:Graphics = graphics;
var commands:Array<Int> = [1, 2, 2, 2, 2];
var data:Array<Float> = [20,10, 50,10, 50,40, 20,40, 20,10];
g.drawPath(commands, data);
Producing the result:
However targeting Flash or html5 is giving compiler errors.
With literals, both targets fail to compile giving error:
Flash
Source/Main.hx:13: characters 19-34 : Array should be flash.Vector
Source/Main.hx:13: characters 19-34 : For function argument âcommandsâ
html5
Source/Main.hx:13: characters 36-71 : Array should be openfl.Vector
Source/Main.hx:13: characters 36-71 : For function argument âdataâ
As typed collections, Flash target continues to give the same compiler error; however, html5 target builds but produces no visual result.
In Graphics.hx, drawPath
is defined as:
public function drawPath (commands:Array<Int>, data:Array<Float>, winding:GraphicsPathWinding = null):Void
Am I not passing expected parameters? Or, am I not implementing path drawing the way OpenFL expects?