Zoom in camera functionality

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
kingomar
Prole
Posts: 37
Joined: Mon Mar 17, 2014 8:01 pm

Zoom in camera functionality

Post 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!
Check out my game:
- Youtube Video : http://goo.gl/91x6dT
- Download Link : http://goo.gl/6llhmp
User avatar
Ranguna259
Party member
Posts: 911
Joined: Tue Jun 18, 2013 10:58 pm
Location: I'm right next to you

Re: Zoom in camera functionality

Post 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 470 times
EDIT: You already posted this, don't spam the forum.
EDIT2: Check out my post on this if you want to know more.
LoveDebug- A library that will help you debug your game with an on-screen fully interactive lua console, you can even do code hotswapping :D

Check out my twitter.
User avatar
alberto_lara
Party member
Posts: 372
Joined: Wed Oct 30, 2013 8:59 pm

Re: Zoom in camera functionality

Post 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 118 times
User avatar
dusoft
Party member
Posts: 492
Joined: Fri Nov 08, 2013 12:07 am
Location: Europe usually
Contact:

Re: Zoom in camera functionality

Post 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)
User avatar
alberto_lara
Party member
Posts: 372
Joined: Wed Oct 30, 2013 8:59 pm

Re: Zoom in camera functionality

Post 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 :)
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 47 guests