Skip to content

Arc

The arc() method creates an arc/curve (used to create circles or partial circles).

Note: to create a circle with arc(), set the start angle to 0 and the end angle to 2 * Math.PI.

ParameterDescription
xThe x coordinate of the center control point.
yThe y coordinate of the center control point.
rArc radian.
startAngleStart radian, measured clockwise from positive x axis.
endAngleEnd radian, measured clockwise from positive x axis.
counterclockwiseDetermines the drawing direction.
Clockwise when set to false (default).
Counterclockwise when set to true.

Example

ts
const ctx = node.getComponent(Graphics);
ctx.arc(100,75,50,0,1.5 * Math.PI);
ctx.stroke();

arc


Return to the Graphics Component Reference documentation.