Draw an arc.
This method can be used to create circles, or parts of circles.
Make sure you call beginPath
before starting the arc unless you wish for the arc to automatically
close when filled or stroked.
Use the optional overshoot
argument increase the number of iterations that take place when
the arc is rendered in WebGL. This is useful if you're drawing an arc with an especially thick line,
as it will allow the arc to fully join-up. Try small values at first, i.e. 0.01.
Call Phaser.GameObjects.Graphics#fillPath or Phaser.GameObjects.Graphics#strokePath after calling this method to draw the arc.
name | type | arguments | Default | description |
---|---|---|---|---|
x | number |
The x coordinate of the center of the circle. |
||
y | number |
The y coordinate of the center of the circle. |
||
radius | number |
The radius of the circle. |
||
startAngle | number |
The starting angle, in radians. |
||
endAngle | number |
The ending angle, in radians. |
||
anticlockwise | boolean | <optional> | false |
Whether the drawing should be anticlockwise or clockwise. |
overshoot | number | <optional> | 0 |
This value allows you to increase the segment iterations in WebGL rendering. Useful if the arc has a thick stroke and needs to overshoot to join-up cleanly. Use small numbers such as 0.01 to start with and increase as needed. |
This Game Object.