How do I zoom gracefully.

Get help using Construct 2

Post » Wed Sep 02, 2015 4:01 am

I've got a simple set up with a zoom variable. Set the layout scale to the value. Use up arrow to zoom in and down to zoom out. The problem is the best zooming is in. You seem to have to set the zoom scale to 1 in order to get the zoom to lerp to normal. The problem is this allows for no zoom out. I guess when the value of scale layout hits zero some other internal calculations get fishy.

What's the most graceful way to zoom below zero, and get back to 1 when zooming out?

Thanks for any advice offered :)
B
7
S
2
Posts: 92
Reputation: 663

Post » Wed Sep 02, 2015 5:56 am

I'm not too sure about zooming with lerp cause I've never used it. What I used in the past was just set layoutscale - 0.5*dt and the opposite to zoom in and out. It was smooth and worked well enough for me.
B
45
S
22
G
31
Posts: 686
Reputation: 20,498

Post » Wed Sep 02, 2015 10:58 am

Hey, thanks for the post. It's not working though.

Key arrow up - set layout scale to 0.05 * dt
Key arrow down - set layout scale to -0.05 * dt

When I press up the sprite just vanishes. Do you think you could post a capx, or anyone else? I can't post mine because of low reputation.
B
7
S
2
Posts: 92
Reputation: 663

Post » Wed Sep 02, 2015 11:13 am

I'm totally new to C2, but do have some programming experience. This is what I did for zoom in my game.

Image
B
6
S
1
Posts: 14
Reputation: 330

Post » Wed Sep 02, 2015 11:21 am

This is the thing though. Your min zoom is 1. That means you're only going to be able to zoom in and then zoom out to normal zoom. This works for me too. But I'm not trying to focus on zoom in.. I really want a zoom out. Like what you would do if you were playing and rts and wanted to see more of the map..

When I zoom lower than 0 and zoom back in the objects are not where they started. It never zooms back to 1 properly after going below zero :(
B
7
S
2
Posts: 92
Reputation: 663

Post » Wed Sep 02, 2015 11:33 am

Message: JeremyBenson11 can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
The weird thing is, I'm watching a YouTube video where the person sets the layout scale to 0.5 and zooms in again by setting the layout scale again, and it works great. Simple. I do the same thing and it does not work the same. There are no errors. When the scale is zoomed out below 0 and back in again everything is shifted up and to the left, and the zoom is not normal, and sprites are not where they started.

https://www.youtube.com/watch?v=QI1J6WX1d9s
B
7
S
2
Posts: 92
Reputation: 663

Post » Wed Sep 02, 2015 11:40 am

As a test I tried setting my min zoom to 0.00001 and it lets me zoom out to the point where I can't even see my game anymore. When I zoom back in its fine.
B
6
S
1
Posts: 14
Reputation: 330

Post » Wed Sep 02, 2015 11:50 am

Okay, I must have a bug. I'll check around. I'm going to update Construct to the latest version, and see if that was the problem.
B
7
S
2
Posts: 92
Reputation: 663

Post » Wed Sep 02, 2015 12:37 pm

This is a really simple zoom I did.....I mean really really simple
https://www.dropbox.com/s/749ffnahbyppxln/SimpleZoom.capx?dl=0

You mean when you zoom back, objects seem to be at slightly different locations from where they originally were? Sounds like you are not using a "scroll to", so your camera doesn't know where to focus to. Look at the capx above and you should be able to understand that part.
B
45
S
22
G
31
Posts: 686
Reputation: 20,498

Post » Wed Sep 02, 2015 1:22 pm

Scroll to isn't a possibility. There are going to be selectable units on the map not a single character. The tutorial I just watched worked fine on YouTube. I just downloaded the latest version of Construct 2 and bought a personal license. I have no idea why this isn't working right.

I'm gonna check out your file though :) Thanks for taking the time. If this doesn't fix I may need to try to get a video of the problem up..
B
7
S
2
Posts: 92
Reputation: 663

Next

Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, MikaelS, nahima and 12 guests