Skip to main content
Version: 9.0.2

canvas.strokeArc

canvas.strokeArc(x, y, radius_x, radius_y, start, end, rotation, color)

Draw a stroked arc defined by the center position (x,y), with x radius radius_x, y radius radius_y, start and end angles (start,end), rotation angle rotation, and with the color color. It fills the shape you get by connecting each end of the arc to the center of the ellipse with a straight line.

Parameters

ParameterTypeDescription
xnumberThe x position of the center of the arc.
ynumberThe y position of the center of the arc.
radius_xnumberThe radius in the x direction.
radius_ynumberThe radius in the y direction.
startnumberThe start angle of the arc in degrees clockwise from the positive x-axis.
endnumberThe end angle of the arc in degrees clockwise from the positive x-axis.
rotationnumberThe rotation angle in degrees clockwise.
colornumberAn RGB color value as an integer value.

Example

// Draw a dashed circle on the canvas with the color red
function dashedCircle(name) {
var canvas = sb.getCanvas(name);
var x = size.width / 2;
var y = size.height / 2;
var r = size.width / 6;
canvas.lineWidth = 0.1 * r;
for(var a = 0; a < 330; a = a+30) {
canvas.strokeArc(x, y, r, r, a, a + 20, 0, 0xff2244);
}
}