Code: Select all
function love.draw()
love.graphics.scale(20) -- really huge scale
love.graphics.setDefaultFilter( 'nearest', 'nearest' )
love.graphics.setLineStyle( "rough" )
love.graphics.circle('line', width/2, height/2, height/2)
end
Code: Select all
function love.draw()
love.graphics.scale(20) -- really huge scale
love.graphics.setDefaultFilter( 'nearest', 'nearest' )
love.graphics.setLineStyle( "rough" )
love.graphics.circle('line', width/2, height/2, height/2)
end
Code: Select all
function drawPixelCircle(x, y, radius, pixelsize)
local points = {}
local dx, dy, err = math.floor(radius / pixelsize), 0, 1-math.floor(radius / pixelsize)
while dx >= dy do
local pdx, pdy = dx * pixelsize, dy * pixelsize
points[#points + 1] = pdx
points[#points + 1] = pdy
points[#points + 1] = -pdx
points[#points + 1] = pdy
points[#points + 1] = pdx
points[#points + 1] = -pdy
points[#points + 1] = -pdx
points[#points + 1] = -pdy
points[#points + 1] = pdy
points[#points + 1] = pdx
points[#points + 1] = -pdy
points[#points + 1] = pdx
points[#points + 1] = pdy
points[#points + 1] = -pdx
points[#points + 1] = -pdy
points[#points + 1] = -pdx
dy = dy + 1
if err < 0 then
err = err + 2 * dy + 1
else
dx, err = dx-1, err + 2 * (dy - dx) + 1
end
end
love.graphics.setPointSize(pixelsize)
love.graphics.push()
love.graphics.translate(x, y)
love.graphics.points(points)
love.graphics.pop()
end
Users browsing this forum: Ahrefs [Bot], Amazon [Bot], Bing [Bot], Google [Bot] and 7 guests