Difference between revisions of "love.graphics.circle (简体中文)"

m
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|X坐标.}}
+
{{param|number|x|圆心的 X 坐标}}
{{param|number|y|Y坐标.}}
+
{{param|number|y|圆心的 Y 坐标}}
{{param|number|radius|圆的半径.}}
+
{{param|number|radius|圆的半径}}
{{param|number|segments (10)|绘制段数.}}
+
{{param|number|segments|画圆的段数或是块数 注:不同版本的 LÖVE 下该参数的默认值是不一样的}}
 
=== Returns ===
 
=== Returns ===
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)
+
    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 (简体中文)| ]]
+
[[Sub-Category::Drawing| ]]
{{#set:Description=Draws a circle.绘制一个圆形.}}
+
{{#set:Description=Draws a circle.}}
 
{{#set:Since=000}}
 
{{#set:Since=000}}
== Other Languages ==
 
{{i18n|love.graphics.circle}}
 

Revision as of 07:19, 29 October 2022

绘制一个圆.

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