love.graphics.circle

Draws a circle.

Function

Synopsis

love.graphics.circle( mode, x, y, radius )

Arguments

DrawMode mode
How to draw the circle.
number x
The position of the center along x-axis.
number y
The position of the center along y-axis.
number radius
The radius of the circle.

Returns

Nothing.

Function

Synopsis

love.graphics.circle( mode, x, y, radius, segments )

Arguments

DrawMode mode
How to draw the circle.
number x
The position of the center along x-axis.
number y
The position of the center along y-axis.
number radius
The radius of the circle.
number segments
The number of segments used for drawing the circle. Note: The default variable for the segments parameter varies between different versions of LÖVE.

Returns

Nothing.

Examples

The effect of the segment argument

function love.draw()
    love.graphics.setColor(1, 1, 1)
    love.graphics.circle("fill", 300, 300, 50, 100) -- Draw white circle with 100 segments.
    love.graphics.setColor(1, 0, 0)
    love.graphics.circle("fill", 300, 300, 50, 5)   -- Draw red circle with five segments.
end

See Also


© 2006–2020 LÖVE Development Team
Licensed under the GNU Free Documentation License, Version 1.3.
https://love2d.org/wiki/love.graphics.circle