CANVAS:fill_ellipse
CANVAS:fill_ellipse(x, y, radius_x, radius_y, rotation, color)
Draw a filled ellipse defined by the center position (x,y), with x radius radius_x, y radius radius_y, rotation angle rotation, and with the color color.
Parameters
| Parameter | Type | Description |
|---|---|---|
x | #number | The x position of the center of the ellipse. |
y | #number | The y position of the center of the ellipse. |
radius_x | #number | The radius in the x direction. |
radius_y | #number | The radius in the y direction. |
rotation | #number | The rotation angle in degrees clockwise. |
color | #number | An RGB color value as an integer value. |
Example
-- Draw a pair of cartoon eyes in black and purple
function Eyes(name)
local canvas = gre.get_canvas(name)
local size = canvas:get_dimensions()
local x = size.width / 2
local y = size.height / 2
local dist = size.width / 4
local s = size.width / 6
canvas:fill_circle(x - dist / 2, y, s, 0xeeccff)
canvas:fill_circle(x + dist / 2, y, s, 0xeeccff)
canvas:fill_ellipse(x - (dist * 1.2) / 2, y, 0.4 * s, 0.5 * s, 0, 0)
canvas:fill_ellipse(x + (dist * 0.8) / 2, y, 0.4 * s, 0.5 * s, 0, 0)
end