Difference between revisions of "love.graphics.circle"

m
m (Update example.)
Line 14: Line 14:
 
Nothing.
 
Nothing.
 
== Examples ==
 
== Examples ==
=== An amazing circle. ===
+
=== The effect of the segment argument ===
 
<source lang="lua">
 
<source lang="lua">
 
function love.draw()
 
function love.draw()
love.graphics.circle( "fill", 300, 300, 50, 100 )
+
    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
 
end
 
</source>
 
</source>

Revision as of 13:54, 25 October 2014

Draws a circle.

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