cokelid Posted April 5, 2017 Share Posted April 5, 2017 I'm trying to draw something like a pie-chart style with filled wedges / arcs. However when I do a filled arc it does not quite fill the entire angle-span. E.g. These two arcs span different angles, even though the calls to graphics.arc are identical... // Filled Arc graphics.lineStyle(1, 0xffd900, 1); graphics.beginFill(0xFF700B); graphics.arc(0, 0, r, game.math.degToRad(0), game.math.degToRad(90), true); graphics.endFill(); // Non-filled Arc graphics.lineStyle(1, 0x00ffff, 1); graphics.arc(0, 0, r, game.math.degToRad(0), game.math.degToRad(90), true); See here: //phaser.io/sandbox/VouJszKL/play The non-filled arc covers the full 270 degrees, but the filled arc is missing the last bit. Any ideas? Thanks! Link to comment Share on other sites More sharing options...
samid737 Posted April 6, 2017 Share Posted April 6, 2017 You can set the accuracy/fidelity as a final argument: graphics.arc(0, 0, r, game.math.degToRad(0), game.math.degToRad(90), true,800); http://phaser.io/docs/2.6.1/PIXI.Graphics.html#arc it will add more segments/ calculation points to your arc.I think (after measuring) your execution time will increase linearly, but you cannot really see a difference in the arc above 800-1000 segments. Link to comment Share on other sites More sharing options...
Recommended Posts