Page 1 of 1

Zoom in camera functionality

Posted: Wed Apr 16, 2014 4:51 pm
by kingomar
Hello everybody! im trying to make an animation in my project and i wanted to zoom while the animation is Going On.

Moreover, when the process of the animation begins i want the camera to zoom so the user can see it in more details. how can i do it? and do i lose image quality?

and how can i set the camera to zoom at a certain coordinates? Thank you!

Re: Zoom in camera functionality

Posted: Wed Apr 16, 2014 5:08 pm
by Ranguna259
You can zoom by using [wiki]love.graphics.scale[/wiki](), to make the camera zoom to a specific coordinate you'll need to use the [wiki]love.graphics.translate[/wiki]() function too.
Here's an exemple, use the mouse wheel to zoom to a coordinate and use the mouse buttons to zoom to the center of the screen:
zoom.love
(860 Bytes) Downloaded 571 times
EDIT: You already posted this, don't spam the forum.
EDIT2: Check out my post on this if you want to know more.

Re: Zoom in camera functionality

Posted: Tue Nov 22, 2022 8:47 pm
by alberto_lara
Way too late but here's a zoom tool I'm working on (to put it in a game). It uses flux just for smoothness but it's not necessary.

This doesn't use love.graphics functions (like translate and scale) at all, it's canvas-based. It'll work for any image size and any canvas size. For zoom = 1, it'll make the image fit whatever window size you have set, even full screen.


Mouse wheel = change zoom
Ctrl + F = full screen toggle
zoom-tool.love
(1.57 MiB) Downloaded 179 times

Re: Zoom in camera functionality

Posted: Tue Nov 22, 2022 10:48 pm
by dusoft
alberto_lara wrote: Tue Nov 22, 2022 8:47 pm Way too late but here's a zoom tool I'm working on (to put it in a game). It uses flux just for smoothness but it's not necessary.

This doesn't use love.graphics functions (like translate and scale) at all, it's canvas-based. It'll work for any image size and any canvas size. For zoom = 1, it'll make the image fit whatever window size you have set, even full screen.


Mouse wheel = change zoom
Ctrl + F = full screen toggle

zoom-tool.love
Wow, that looks really cool! (just the cursor seems to be invisible)

Re: Zoom in camera functionality

Posted: Tue Nov 22, 2022 11:35 pm
by alberto_lara
Yup, I'm using

Code: Select all

love.mouse.setRelativeMode(true)
but you can remove than and play around, if this is still something you're interested in :)