Hi!
As the topic says there’s a problem with graphics.drawTriangles() on HTML5 target.
Here’s a simple example using a triangle. The vertices are defined like this:
If I target flash the output is as expected. On HTML5 only the red part of the triangle can be seen:
So obviously just the parts of the shape which lie within positive coordinates get drawn.
Additionally canvas.graphics.lineStyle() doesn’t seem to do anything at all on HTML5.
Here’s the code:
package;
import openfl.display.*;
import openfl.Vector;
import openfl.geom.*;
class Main extends Sprite
{
public function new()
{
super();
var vertices:Vector<Float> = [0.0, -20.0, -30.0, 10.0, 30.0, 10.0];
var canvas:Shape = new Shape();
canvas.graphics.beginFill(0x0000FF);
canvas.graphics.lineStyle(1, 0xffffff);
canvas.graphics.drawTriangles(vertices);
canvas.graphics.endFill();
canvas.x = (stage.stageWidth - canvas.width) / 2;
canvas.y = (stage.stageHeight - canvas.width) / 2;
addChild(canvas);
}
}
Thanks!