Image angle to mouse?
Posted: Sun Feb 22, 2015 9:03 am
I am trying to make this image of the letter L basically rotate its angle by where the mouse position of Y is. The way I have it setup makes it rotate uncontrollably fast and also rotates around the back of the L when I want it to rotate up/down from the top of the L. I do have source to show you what it does..How could I fix this so the image can rotate up/down with the mouse? also code below too.
Code: Select all
function love.load()
love.graphics.setBackgroundColor(0,200,200)
x = love.graphics.getWidth() / 2
y = love.graphics.getHeight() / 2
letter = love.graphics.newImage("letter.png")
end
Code: Select all
function love.update(dt)
mx, my = love.mouse.getPosition()
end
Code: Select all
function love.draw()
love.graphics.setColor(255, 255, 255)
love.graphics.draw(letter,x,y,my)
end