Code: Select all
Object = love.new.graphics.newImage("blah.jpg")
Object.Rotation = 90 --degrees
love.graphics.draw(Object,400,400)
I have no idea how to use the current rotation, and this would make things easier for me.
Code: Select all
Object = love.new.graphics.newImage("blah.jpg")
Object.Rotation = 90 --degrees
love.graphics.draw(Object,400,400)
Code: Select all
love.graphics.draw(drawable, x + width / 2, y + height / 2, rotation, 1, 1, width / 2, height / 2)
Code: Select all
love.graphics.draw(drawable, x, y, rotation, 1, 1, width / 2, height / 2)
I realise that; it all depends on which coordinate system you use (love.graphics uses top-left, but love.physics uses centric). You've also alerted me to the fact that I was subtracting the half width and height instead of adding (which I've fixed).slime wrote:The above will work if your x and y variables correspond to the top-left coordinates of the image, which doesn't make much sense if you're also adding the offset. This will work fine:
Code: Select all
love.graphics.draw(drawable, x, y, rotation, 1, 1, width / 2, height / 2)
Users browsing this forum: No registered users and 3 guests