Rotating an image to face another point?
Posted: Mon Jan 11, 2016 10:59 pm
Hi, I'm kind of new to love, and I was curious to see how I can rotate an image to make it point to a certain point. (The mouse cursor position.)
function love.draw(dt)
love.graphics.draw(player.img, player.x, player.y, player.r) --player is a table value storing the information of the player
end
all i'd like to do is set player.r to make it face towards love.mouse:getX() and love.mouse:getY()
I may not sound like I know when I'm saying since i just started love.
Thanks
function love.draw(dt)
love.graphics.draw(player.img, player.x, player.y, player.r) --player is a table value storing the information of the player
end
all i'd like to do is set player.r to make it face towards love.mouse:getX() and love.mouse:getY()
I may not sound like I know when I'm saying since i just started love.
Thanks