Merge pull request #65 from tesselode/master

allow passing segments argument to CircleShape:draw()
This commit is contained in:
Matthias Richter 2021-09-07 13:40:38 +02:00 committed by GitHub
commit 9a05518300
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -284,6 +284,13 @@ Built-in Shapes
.. class:: CircleShape .. class:: CircleShape
.. function:: CircleShape:draw(mode, segments)
:param DrawMode mode: How to draw the shape. Either 'line' or 'fill'.
:param number segments: The number of segments to draw the circle with.
Draw the circle shape either filled or as an outline and with the specified number of segments.
.. class:: PointShape .. class:: PointShape
.. function:: newPolygonShape(...) .. function:: newPolygonShape(...)

View File

@ -418,7 +418,8 @@ function ConcavePolygonShape:draw(mode, wireframe)
end end
function CircleShape:draw(mode, segments) function CircleShape:draw(mode, segments)
love.graphics.circle(mode or 'line', self:outcircle()) local x, y, r = self:outcircle()
love.graphics.circle(mode or 'line', x, y, r, segments)
end end
function PointShape:draw() function PointShape:draw()