Zooming into the mouse coords.

0 favourites
  • 6 posts
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • I'm trying to do a map effect, which scrolls keyys and can be zoomed in or out using the mouse wheel. This is working, but I can't work out how to zoom in to the spot that the mouse is hovering over. So the effect would be, when you hold your mouse over a sprite and zoom in, that sprite would hold it's location and the centre point would instead be altered. Capx included to show what I'm trying to do...

    Arrow keys to move around, mouse wheel to zoom in and out.

  • Wow, forum is busy, so doing a bump. Can't fathom this one out myself, or find anything relating to it

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm at work so I can't look at the capx, but could you implement a scroll to the mouse coordinates as it zooms? So for each zoom increment it also scrolls towards the mouse coordinates?

  • That's sorta what I'm looking to do. I tried scrolling directly to the mouse, but obviously that doesn't work because then if you scroll twice, the object moves away from your pointer. It's better explained in the capx really, I'd appreciate it if you could take a look some time. Basically, I know what I'm trying to do and I think I know how to do it, I just can't figure out the math.

  • farflamex, Were you successful in getting this work?

  • I was yes, it's been a while, but I did get it working. If you want an update for your own work, I can probably post some code.

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