Is the love.graphics.scale() the appropriate way to scale a single image, using push and pop with it?
This doesn't seem too practical if so because it offsets the location on screen of the image.
This command seems more geared towards total screen zooming.
Below is a small script i made to test scaling.
One block scales and one doesn't. But the scaling block moves across the screen while scaling before ending up at it's correct x and y position.
Is this the only way of scaling a single image? This would require creating offsets of positions for images which could become pretty messy to deal with.
I hope I'm just missing something lol.
Code: Select all
function love.load()
block = love.graphics.newImage("/images/block.png")
x = 300
y = 300
scale = 0.5
end
function love.update(dt)
if scale < 1 then
scale = scale + 0.01
end
end
function love.draw()
love.graphics.push()
love.graphics.scale(scale,scale)
love.graphics.draw(block,x,y)
love.graphics.pop()
love.graphics.draw(block,30,30)
end