Difference between revisions of "love.graphics.ellipse"
(Created page) |
m |
||
(5 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{newin|[[0.10.0]]|100|type=function}} | {{newin|[[0.10.0]]|100|type=function}} | ||
Draws an ellipse. | Draws an ellipse. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Function == | == Function == | ||
=== Synopsis === | === Synopsis === | ||
Line 23: | Line 10: | ||
{{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 along y-axis.}} | {{param|number|y|The position of the center along y-axis.}} | ||
− | {{param|number|radiusx|The radius of the ellipse along the x-axis (half the ellipse's width. | + | {{param|number|radiusx|The radius of the ellipse along the x-axis (half the ellipse's width).}} |
− | {{param|number|radiusy|The radius of the ellipse along the y-axis (half the ellipse's height. | + | {{param|number|radiusy|The radius of the ellipse along the y-axis (half the ellipse's height).}} |
− | {{param|number|segments|The number of segments used for drawing the ellipse.}} | + | {{param|number|segments (nil)|The number of segments used for drawing the ellipse (automatically guessed when not set).}} |
=== Returns === | === Returns === | ||
Nothing. | Nothing. | ||
Line 32: | Line 19: | ||
<source lang="lua"> | <source lang="lua"> | ||
function love.draw() | function love.draw() | ||
− | love.graphics.setColor( | + | love.graphics.setColor(1, 1, 1) |
− | love.graphics.ellipse("fill", 300, 300, 75, 50, 100) | + | love.graphics.ellipse("fill", 300, 300, 75, 50, 100) -- Draw white ellipse with 100 segments. |
− | love.graphics.setColor( | + | |
− | love.graphics.ellipse("fill", 300, 300, 75, 50, 5) | + | love.graphics.setColor(1, 0, 0) |
+ | love.graphics.ellipse("fill", 300, 300, 75, 50, 5) -- Draw red ellipse with five segments. | ||
end | end | ||
</source> | </source> |
Latest revision as of 13:07, 14 July 2022
Available since LÖVE 0.10.0 |
This function is not supported in earlier versions. |
Draws an ellipse.
Contents
Function
Synopsis
love.graphics.ellipse( mode, x, y, radiusx, radiusy, segments )
Arguments
DrawMode mode
- How to draw the ellipse.
number x
- The position of the center along x-axis.
number y
- The position of the center along y-axis.
number radiusx
- The radius of the ellipse along the x-axis (half the ellipse's width).
number radiusy
- The radius of the ellipse along the y-axis (half the ellipse's height).
number segments (nil)
- The number of segments used for drawing the ellipse (automatically guessed when not set).
Returns
Nothing.
Examples
The effect of the segment argument
function love.draw()
love.graphics.setColor(1, 1, 1)
love.graphics.ellipse("fill", 300, 300, 75, 50, 100) -- Draw white ellipse with 100 segments.
love.graphics.setColor(1, 0, 0)
love.graphics.ellipse("fill", 300, 300, 75, 50, 5) -- Draw red ellipse 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