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
| 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
//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);
}