I'm new to LUA and Love2D and I'm getting this problem, I've tried searching for an answer already but no luck.
When I use graphics.setColor it's coloring my "background" image too.
Here's my code:
Code: Select all
function love.draw()
love.graphics.scale(love.graphics.getWidth()/800, love.graphics.getHeight()/600)
love.graphics.draw(background, 0, 0)
love.graphics.setLineWidth(10)
love.graphics.setLineStyle("smooth")
love.graphics.setColor(255, 0, 0)
love.graphics.line(200,50, 400,50, 500,300, 100,300, 200,50)
love.graphics.setColor(0, 255, 0)
love.graphics.line(250,50, 450,50, 550,300, 150,300, 250,50)
love.graphics.setColor(0, 0, 255)
love.graphics.line(350,50, 550,50, 650,300, 250,300, 350,50)
end
On a side question, how come adding this line to love.draw() works but not love.resize(w, h)?
Code: Select all
love.graphics.scale(love.graphics.getWidth()/800, love.graphics.getHeight()/600)