Zoom in or out when any sprite is on center of view

Get help using Construct 2

Post » Fri Sep 16, 2016 3:31 pm

Hi guys,

I want set camera view with zoom out when see for example Sprite 1 and zoom "normal" when is see Sprite 2.
Can any post me a example capx?
B
10
Posts: 53
Reputation: 460

Post » Sat Sep 17, 2016 12:23 am

On has line of sight/ every tick distance sprite.x/y sprite.x/y

Set ...Ok on phone no c2 (clubbing is dull lol), i think it's system zoom layout x 2. And same applies with sprite 3. Problem you may get is when both sprites are on screen, so you need a pick closest. If you have full version, make the target sprites a family, then pick nearest family. Otherwise, something like:
Every tick set global variable to distance (sprite.xsprite.y,sprite2.x/y) and gv2 too distance(sprite.x/y,sprite.x/y)

Gv>gv2: set zoom 200%
Gv2 >gv: set zoom to 100%

Really hope this helps, any questions I'll try to help again
B
9
S
3
Posts: 102
Reputation: 987

Post » Sat Sep 17, 2016 3:29 am

SnowBeat wrote:Hi guys,

I want set camera view with zoom out when see for example Sprite 1 and zoom "normal" when is see Sprite 2.
Can any post me a example capx?


Like this? :mrgreen:

https://www.dropbox.com/s/m6b23002n006m ... .capx?dl=0

If you want to learn more about how to properly zoom in and out, check out fisholith's superb teaching below.

how-do-i-zoom-in-out-scroll-to_t125060
B
11
S
6
G
15
Posts: 256
Reputation: 9,207

Post » Mon Sep 19, 2016 6:19 am

Yes its good example, and if i want to zoom for example when goal is in view camera = zoom to goal ?
B
10
Posts: 53
Reputation: 460


Return to How do I....?

Who is online

Users browsing this forum: jorgmaquoi, R0J0hound, tarek2 and 12 guests