Skip to main content
Version: 9.0.2

canvas.strokeCircle

canvas.strokeCircle(x, y, radius, color)

Draw a stroked circle defined by the center position (x,y), with radius radius, and with the color color.

Parameters

ParameterTypeDescription
xnumberThe x position of the center of the circle.
ynumberThe y position of the center of the circle.
radiusnumberThe radius of the circle.
colornumberAn RGB color value as an integer value.

Example

// Draw two stroked circles on the canvas with the color black
function tires(name) {
var canvas = sb.getCanvas(name);
var x = size.width / 2;
var y = size.height / 2;
var r = size.width / 9;
var dist = size.width / 2;
canvas.lineWidth = 0.6 * r;
canvas.strokeCircle(x + dist / 2, y, r, 0);
canvas.strokeCircle(x - dist / 2, y, r, 0);
}