I think I've been doing decent here, but there's obviously something wrong. I wanted to make the rotation centered at the middle of the picture, not the ship.x point. However it doesn't seem like using the (ship.x+imgs.ship:getWidth())/2 is getting me that...
Any help guys?
My first experiments with mouse detection and image rotation
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 12
- Joined: Sun Jan 27, 2013 6:00 am
Re: My first experiments with mouse detection and image rota
Check out the offset arguments of love.graphics.draw
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
-
- Prole
- Posts: 12
- Joined: Sun Jan 27, 2013 6:00 am
Re: My first experiments with mouse detection and image rota
That's what I was thinking about...What exactly ARE the offsets? I noticed them in other people's sources but I don't really know what they are.
Re: My first experiments with mouse detection and image rota
They move the ship image left and up by their amount, and the ship image rotation center by their amount right and down. Example, to rotate an image around its center:
Code: Select all
love.graphics.draw(ship.image, ship.x, ship.y, ship.rotation, 1, 1, ship.image:getWidth()/2, ship.image:getHeight()/2)
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
-
- Prole
- Posts: 12
- Joined: Sun Jan 27, 2013 6:00 am
Re: My first experiments with mouse detection and image rota
Awesome! I've been wanting this. Thank you!
Who is online
Users browsing this forum: Amazon [Bot] and 7 guests