function love.load()
x, y = 0, 0
width, height = 10, 10
love.graphics.setBackgroundColor(80,80,80)
canvas = love.graphics.newCanvas(200, 200)
end
function love.update()
x, y = x + 0.1, y + 0.1
end
function love.draw()
love.graphics.setCanvas(canvas)
love.graphics.rectangle("fill", x, y, width, height)
love.graphics.setCanvas()
love.graphics.draw(canvas, 0, 0)
end
After you setCanvas, immediately clear it before you start drawing anything.
love.graphics.clear(color)
Where color is the color to make it. Use 0,0,0,0 or 255,255,255,0 or any other color as long as zero is the fourth (alpha) number if you want it to be transparent. Or leave the alpha empty if you want it opaque.
Jasoco wrote:After you setCanvas, immediately clear it before you start drawing anything.
love.graphics.clear(color)
Where color is the color to make it. Use 0,0,0,0 or 255,255,255,0 or any other color as long as zero is the fourth (alpha) number if you want it to be transparent. Or leave the alpha empty if you want it opaque.