zoom between two objects

0 favourites
  • 3 posts
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • Hello friends,

    I can make the screen scroll to a location in the center of two objects, however I need to have the layer zoom out as they move further apart.

    To scroll to center:

    Scroll to position ->



    Do I need to set an initial variable with the number Distance(obj1,x,obj1.y,obj2.x,obj2.y, then compare that with the current distance clamped so it does not get to small? I think I have the principle, but I am not sure how to do it right...


  • A bit of a guess here (not really used it much)

    add the "scroll to" behaviour to both your objects - this should keep the screen centred between them.

    setting the scale to the screen height (assuming this is smaller than the screen width) divided by the distance between the two objects should keep them in view.

    You might not want to scale if they are too close so add something like if distance is greater than screen height

    as you said you will also need to make sure the scale doesn't get too small.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I found the plugin Magicam which works perfect, and it was just updated too!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)