Skip to main content
Version: 9.0.2

canvas.fillCircle

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

Draw a filled 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

//Fill a circle on the canvas with the color red
function redBalloon(name) {
var canvas = sb.getCanvas(name);
var x = canvas.width / 2;
var y = canvas.height / 2;
var radius = canvas.width / 6;
canvas.fillCircle(x, y, radius, 0xff2244);
}