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

(Examples)
m (Stop breaking parents)
 
(One intermediate revision by one other user not shown)
Line 40: Line 40:
  
 
== See Also ==
 
== See Also ==
* [[parent::love.graphics]]
+
* [[parent::love.graphics (简体中文)]]
 
* [[love.graphics.arc]]
 
* [[love.graphics.arc]]
 
* [[love.graphics.ellipse]]
 
* [[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}}

Latest revision as of 21:39, 30 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



Other Languages