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
| Parameter | Type | Description |
|---|---|---|
x | number | The x position of the center of the circle. |
y | number | The y position of the center of the circle. |
radius | number | The radius of the circle. |
color | number | An 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);
}