Between Sprites Distance + Zoom

0 favourites
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • Any ideas on how I can accomplish this with 4 players running around on a screen? Right now it's only taking the distance of 2 players. Would you have to compare the X and Y distance of every player, then choose the max ones?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello Im super new but would be so thankful for a tip on how to accomplish Naelian's code.

    I tried "Naelian's" way and ended up having this: (sorry I can't upload my dropboxed screenshot)

    On every ticks ->

    set layout scale to clamp(1 - distance(p1.x, p1.y, p2.x, p2.y) / (layoutHeight + layoutWidth), 0.5, 1)

    scroll to ( (p1.X+p2.X)/2, ((p1.Y+p2.Y)/2 ) JUST FOUND OUT THAT MY SCROLL TO ACTION DOESNT WORK AT ALL

    I set the Naelian's "0.1 and 1) to "0.5 and 1" but Im not quiet sure what they really do. Now I ended up with having the superb opposite of what i want. If the two player are close my window/levelbackground is like fullscreen and when the two player go as far as they can its about 50% zoomed out.

    But I want it to be "full" when the player are far away and just a little zoomed in when they get closer. Inverting the "0.5,1" to a "1,0.5" didn't solve it. All just stayed "full" without zooming. This must be funny for you

    Please help

    Thank you!

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