Skip to main content
Version: 9.0.2

CANVAS:stroke_arc

CANVAS:stroke_arc(x, y, radius_x, radius_y, start_angle, end_angle, rotation, color)

Draw a stroked arc defined by the center position (x,y), with x radius radius_x, y radius radius_y, start and end angles (start_angle, end_angle), 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

ParameterTypeDescription
x#numberThe x position of the center of the arc.
y#numberThe y position of the center of the arc.
radius_x#numberThe radius in the x direction.
radius_y#numberThe radius in the y direction.
start_angle#numberThe start angle of the arc in degrees clockwise from the positive x axis.
end_angle#numberThe end angle of the arc in degrees clockwise from the positive x axis.
rotation#numberThe rotation angle in degrees clockwise.
color#numberAn RGB color value as an integer value.

Example

-- Draw a dashed circle on the canvas with the color red
function DashedCircle(name)
local canvas = gre.get_canvas(name)
local size = canvas:get_dimensions()
local x = size.width / 2
local y = size.height / 2
local r = size.width / 6
canvas:set_line_width(0.1 * r)
for a = 0, 330, 30 do
canvas:stroke_arc(x, y, r, r, a, a + 20, 0, 0xff2244)
end
end