[SOLVED] setColor usage
Posted: Sun Jul 29, 2018 12:17 pm
Hello,
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:
And here's the result:
How come the last color I apply (blue) gets applied to the whole screen? How can I prevent that?
On a side question, how come adding this line to love.draw() works but not love.resize(w, h)?
Thanks in advance
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)