Page 2 of 3

Re: Cameras in Love2D (Tutorials)

Posted: Sun Jun 12, 2011 9:12 am
by T-Bone
Consider adding them to the wiki, they are much easier to find there.

Re: Cameras in Love2D (Tutorials)

Posted: Sun Jun 12, 2011 10:29 am
by BlackBulletIV
Will do. :)

Re: Cameras in Love2D (Tutorials)

Posted: Tue Aug 09, 2011 8:50 pm
by Cantide
Thanks for the awesome tutorials and code :D I've just implemented it tonight, and it works really well.
Just one problem I've had... my mouse cursor position doesn't seem to update as the camera moves. How would I be able to correct this? :|

Re: Cameras in Love2D (Tutorials)

Posted: Wed Aug 10, 2011 2:30 am
by BlackBulletIV
Thanks for the feedback.
Cantide wrote:my mouse cursor position doesn't seem to update as the camera moves. How would I be able to correct this? :|
Can you explain what you mean?

Re: Cameras in Love2D (Tutorials)

Posted: Wed Aug 10, 2011 2:32 am
by TechnoCat
BlackBulletIV wrote:Thanks for the feedback.
Cantide wrote:my mouse cursor position doesn't seem to update as the camera moves. How would I be able to correct this? :|
Can you explain what you mean?
I'm assuming love.mouse.getPosition()
You'll have to do the same transformations you do to the camera, to the cursor positions.

Re: Cameras in Love2D (Tutorials)

Posted: Wed Aug 10, 2011 4:17 am
by BlackBulletIV
If that's the case, then I explained that in part 1. Although I didn't show it in the tutorial (as it's a matter of taste), I personally redefine love.mouse.getPosition/getX/getY to do those transformations.

Re: Cameras in Love2D (Tutorials)

Posted: Wed Aug 10, 2011 6:35 pm
by Cantide
Technocat, I tried to do it that way, but it didn't work properly.... I can't even begin to describe the bug I was getting. *_*
After checking the tutorials again I got it right, thanks BlackBulletIV! :)

Re: Cameras in Love2D (Tutorials)

Posted: Wed Aug 10, 2011 7:13 pm
by TechnoCat
Cantide wrote:Technocat, I tried to do it that way, but it didn't work properly.... I can't even begin to describe the bug I was getting. *_*
After checking the tutorials again I got it right, thanks BlackBulletIV! :)
You'll have to do it in reverse order.
X -> X' camera translation
X' -> X cursor translation

Re: Cameras in Love2D (Tutorials)

Posted: Thu Aug 11, 2011 3:56 am
by BlackBulletIV
Cantide wrote:After checking the tutorials again I got it right, thanks BlackBulletIV! :)
Glad to be of help!

Re: Cameras in Love2D (Tutorials)

Posted: Fri Aug 12, 2011 9:10 pm
by The Burrito
Nice tutorial, these camera coords are top left correct? if so I might recommend adding a centering option to the set position and scalar, zooming especially looks really confusing if the camera doesn't stay centered on the same point.