CANVAS:fill arc

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: x The x position of the center of the arc y The y position of the center of the arc radius_x The radius in the x direction radius_y The radius in the y direction start The start angle of the arc in degrees clockwise from the positive x axis end The end angle of the arc in degrees clockwise from the positive x axis rotation The rotation angle in degrees clockwise color An RGB color value as an integer value

-- Draw a whole pie and slice of pie on the canvas with the color white
function Pie(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:fill_arc(x, y, r, r, 0, 52, 0, 0xffffff)
  canvas:fill_arc(x, y, r, r, 60, 352, 0, 0xffffff)
end
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

0 comments

Article is closed for comments.