Difference between revisions of "love.graphics.circle (简体中文)"
(Created page with "绘制一个圆形. == Function == === Synopsis === <source lang="lua"> love.graphics.circle( mode, x, y, radius, segments ) </source> === Arguments === {{param|DrawMode|mode|如...") |
m (Stop breaking parents) |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | + | ||
+ | 绘制一个圆. | ||
+ | == Function == | ||
+ | === Synopsis === | ||
+ | <source lang="lua"> | ||
+ | love.graphics.circle( mode, x, y, radius ) | ||
+ | </source> | ||
+ | === Arguments === | ||
+ | {{param|DrawMode|mode|用什么方式绘制圆,目前有两种“fill”和“line”,也就是填充还是画线的意思}} | ||
+ | {{param|number|x|圆心的 X 坐标}} | ||
+ | {{param|number|y|圆心的 Y 坐标}} | ||
+ | {{param|number|radius|圆的半径}} | ||
+ | === Returns === | ||
+ | 无返回. | ||
+ | |||
== Function == | == Function == | ||
=== Synopsis === | === Synopsis === | ||
Line 6: | Line 20: | ||
</source> | </source> | ||
=== Arguments === | === Arguments === | ||
− | {{param|DrawMode|mode| | + | {{param|DrawMode|mode|用什么方式绘制圆,目前有两种“fill”和“line”,也就是填充还是画线的意思}} |
− | {{param|number|x| | + | {{param|number|x|圆心的 X 坐标}} |
− | {{param|number|y| | + | {{param|number|y|圆心的 Y 坐标}} |
− | {{param|number|radius|圆的半径 | + | {{param|number|radius|圆的半径}} |
− | {{param|number|segments | + | {{param|number|segments|画圆的段数或是块数 注:不同版本的 LÖVE 下该参数的默认值是不一样的}} |
=== Returns === | === Returns === | ||
− | + | 无返回 | |
+ | |||
== 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]] | ||
− | {{#set:Description=Draws a circle | + | [[Sub-Category::Drawing (简体中文)| ]] |
+ | {{#set:Description=Draws a circle.}} | ||
{{#set:Since=000}} | {{#set:Since=000}} | ||
+ | |||
== Other Languages == | == Other Languages == | ||
{{i18n|love.graphics.circle}} | {{i18n|love.graphics.circle}} |
Latest revision as of 21:39, 30 October 2022
绘制一个圆.
Contents
Function
Synopsis
love.graphics.circle( mode, x, y, radius )
Arguments
DrawMode mode
- 用什么方式绘制圆,目前有两种“fill”和“line”,也就是填充还是画线的意思
number x
- 圆心的 X 坐标
number y
- 圆心的 Y 坐标
number radius
- 圆的半径
Returns
无返回.
Function
Synopsis
love.graphics.circle( mode, x, y, radius, segments )
Arguments
DrawMode mode
- 用什么方式绘制圆,目前有两种“fill”和“line”,也就是填充还是画线的意思
number x
- 圆心的 X 坐标
number y
- 圆心的 Y 坐标
number radius
- 圆的半径
number segments
- 画圆的段数或是块数 注:不同版本的 LÖVE 下该参数的默认值是不一样的
Returns
无返回
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