canvas.fillArc
canvas.fill_arc(x, y, radius_x, radius_y, start, end, rotation, color)
Draw a filled 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
| Parameter | Type | Description |
|---|---|---|
x | number | The x position of the center of the arc. |
y | number | The y position of the center of the arc. |
radius_x | number | The radius in the x direction. |
radius_y | number | The radius in the y direction. |
start | number | The start angle of the arc in degrees clockwise from the positive x axis. |
end | number | The end angle of the arc in degrees clockwise from the positive x axis. |
rotation | number | The rotation angle in degrees clockwise. |
color | number | An RGB color value as an integer value. |
Example
//Draw a whole pie and slice of pie on the canvas with the color white
function pie(name) {
var canvas = sb.getCanvas(name);
var x = canvas.width / 2;
var y = canvas.height / 2;
var r = canvas.width / 6;
canvas.fillArc(x, y, r, r, 0, 52, 0, 0xffffff);
canvas.fillArc(x, y, r, r, 60, 352, 0, 0xffffff);
}