Skip to main content
Version: 9.0.2

CANVAS:stroke_ellipse

CANVAS:stroke_ellipse(x, y, radius_x, radius_y, rotation, color)

Draw a stroked 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

ParameterTypeDescription
x#numberThe x position of the center of the ellipse.
y#numberThe y position of the center of the ellipse.
radius_x#numberThe radius in the x direction.
radius_y#numberThe radius in the y direction.
rotation#numberThe rotation angle in degrees clockwise.
color#numberAn RGB color value as an integer value.

Example

-- Draw two stroked ellipses on the canvas with the color black
function FastTires(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 / 9
local dist = size.width / 2
canvas:set_line_width(0.6 * r)
canvas:stroke_ellipse(x + dist / 2, y, r, 1.1 * r, 15, 0)
canvas:stroke_ellipse(x - dist / 2, y, r, 1.1 * r, 15, 0)
end