love.graphics.ellipse

love.graphics.ellipse

Available since LÖVE 0.10.0
This function is not supported in earlier versions.

Draws an ellipse.

Function

Synopsis

1
love.graphics.ellipse( mode, x, y, radiusx, radiusy )

Arguments

DrawMode mode
How to draw the ellipse.
number x
The position of the center along x-axis.
number y
The position of the center along y-axis.
number radiusx
The radius of the ellipse along the x-axis (half the ellipse's width.)
number radiusy
The radius of the ellipse along the y-axis (half the ellipse's height.)

Returns

Nothing.

Function

Synopsis

1
love.graphics.ellipse( mode, x, y, radiusx, radiusy, segments )

Arguments

DrawMode mode
How to draw the ellipse.
number x
The position of the center along x-axis.
number y
The position of the center along y-axis.
number radiusx
The radius of the ellipse along the x-axis (half the ellipse's width.)
number radiusy
The radius of the ellipse along the y-axis (half the ellipse's height.)
number segments
The number of segments used for drawing the ellipse.

Returns

Nothing.

Examples

The effect of the segment argument

1
2
3
4
5
6
function love.draw()
    love.graphics.setColor(255, 255, 255)
    love.graphics.ellipse("fill", 300, 300, 75, 50, 100) -- Draw white ellipse with 100 segments.
    love.graphics.setColor(255, 0, 0)
    love.graphics.ellipse("fill", 300, 300, 75, 50, 5)   -- Draw red ellipse with five segments.
end

See Also


doc_love
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.