Ellipse

From Sim Innovations Wiki
Jump to navigation Jump to search

Description

_ellipse(cx, cy, radius_x, radius_y)

_ellipse is used to draw an ellipse.

Info This function may only be called within a canvas draw callback

Return value

This function won't return any value.

Arguments

# Argument Type Description
1 cx Number Left point of the center of the ellipse.
2 cy Number Top point of the center of the ellipse.
3 radius_x Number Horizontal radius of the ellipse in pixels.
4 radius_y Number Vertical radius of the ellipse in pixels.

Example

canvas_id = canvas_add(0, 0, 200, 200, function()
  -- Create a ellipse
  _ellipse(100, 100, 100, 50)

  _fill("red")
end)
Output of code above