love.graphics.arc (简体中文)

Available since LÖVE 0.8.0
This function is not supported in earlier versions.

绘制一段弧.

Function

Synopsis

love.graphics.arc( mode, x, y, radius, angle1, angle2, segments )

Arguments

DrawMode mode
如何绘制这个弧.
number x
X坐标.
number y
Y坐标.
number radius
圆弧的半径
number angle1
开始的角度
number angle2
结束的角度
number segments (10)
The number of segments used for drawing the arc.用于绘制弧的段数

Returns

Nothing.

Examples

绘制一个半圆

function love.draw( )
  love.graphics.arc( "fill", 400, 300, 100, 0, math.pi )
end

绘制一个 Pacman(吃豆人:)

pacwidth = math.pi / 6 -- 嘴的大小
function love.draw( )
  love.graphics.setColor( 255, 255, 0 ) -- 吃豆人是黄色滴
  love.graphics.arc( "fill", 400, 300, 100, pacwidth, (math.pi * 2) - pacwidth )
end

See Also

Other Languages