Difference between revisions of "love.graphics.circle"
(→Arguments) |
|||
(20 intermediate revisions by 11 users not shown) | |||
Line 1: | Line 1: | ||
+ | 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. Has 2 modes: "fill" and "line".}} | ||
+ | {{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 9: | Line 22: | ||
{{param|DrawMode|mode|How to draw the circle.}} | {{param|DrawMode|mode|How to draw the circle.}} | ||
{{param|number|x|The position of the center along x-axis.}} | {{param|number|x|The position of the center along x-axis.}} | ||
− | {{param|number|y|The position of the center | + | {{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 | + | {{param|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 === | === Returns === | ||
Nothing. | Nothing. | ||
+ | |||
== Examples == | == Examples == | ||
− | === | + | === The effect of the segment argument === |
<source lang="lua"> | <source lang="lua"> | ||
function love.draw() | 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 | end | ||
</source> | </source> | ||
== See Also == | == See Also == | ||
* [[parent::love.graphics]] | * [[parent::love.graphics]] | ||
+ | * [[love.graphics.arc]] | ||
+ | * [[love.graphics.ellipse]] | ||
[[Category:Functions]] | [[Category:Functions]] | ||
+ | [[Sub-Category::Drawing| ]] | ||
{{#set:Description=Draws a circle.}} | {{#set:Description=Draws a circle.}} | ||
+ | {{#set:Since=000}} | ||
+ | |||
+ | == Other Languages == | ||
+ | {{i18n|love.graphics.circle}} |
Latest revision as of 09:54, 1 November 2023
Draws a circle.
Contents
Function
Synopsis
love.graphics.circle( mode, x, y, radius )
Arguments
DrawMode mode
- How to draw the circle. Has 2 modes: "fill" and "line".
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
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info