Hello.
How to rotate the image created by love.graphics.newImage()?
Very thanks for replies.
Image rotation
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Image rotation
If you are only drawing one image...
To convert an angle to radian, you can use...
When you use this it rotates from 0,0 not your image's x,y so you have to compensate. Is that what you meant?
Code: Select all
function love.draw()
love.graphics.rotate(angleInRadians) -- Rotates all items drawn.
love.graphics.draw(yourImage,x,y) -- Draws your image.
end
Code: Select all
radian = angle*math.pi/180
- Jasoco
- Inner party member
- Posts: 3728
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Image rotation
Well, if you have more than one image, you use the image's rotation parameter itself.
Code: Select all
love.graphics.draw(image, x, y, rotation_in_radians, scale_x, scale_y, offset_x, offset_y)
Who is online
Users browsing this forum: Ahrefs [Bot] and 6 guests