Clear a canvas?
Posted: Wed May 11, 2016 4:02 pm
Hello!
I'm getting this weird constant drawing effect when I'm drawing something on a canvas.
Am I doing something wrong?
I'm getting this weird constant drawing effect when I'm drawing something on a canvas.
Am I doing something wrong?
Code: Select all
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