Difference between revisions of "love.graphics.circle"

(Re-add default segments value)
m
Line 1: Line 1:
 
Draws a circle.
 
Draws a circle.
 +
== Function ==
 +
=== Synopsis ===
 +
<source lang="lua">
 +
love.graphics.circle( mode, x, y, radius )
 +
</source>
 +
=== Arguments ===
 +
{{param|DrawMode|mode|How to draw the circle.}}
 +
{{param|number|x|The position of the center along x-axis.}}
 +
{{param|number|y|The position of the center along y-axis.}}
 +
{{param|number|radius|The radius of the circle.}}
 +
=== Returns ===
 +
Nothing.
 +
 
== Function ==
 
== Function ==
 
=== Synopsis ===
 
=== Synopsis ===
Line 10: Line 23:
 
{{param|number|y|The position of the center along y-axis.}}
 
{{param|number|y|The position of the center along y-axis.}}
 
{{param|number|radius|The radius of the circle.}}
 
{{param|number|radius|The radius of the circle.}}
{{param|number|segments (max(10, radius))|The number of segments used for drawing the circle.}}
+
{{param|number|segments|The number of segments used for drawing the circle.}}
 
=== Returns ===
 
=== Returns ===
 
Nothing.
 
Nothing.
 +
 
== Examples ==
 
== Examples ==
 
=== The effect of the segment argument ===
 
=== The effect of the segment argument ===

Revision as of 16:25, 25 October 2016

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.

Returns

Nothing.

Examples

The effect of the segment argument

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

See Also


Other Languages