Zooming into the mouse coords.

Get help using Construct 2

Post » Wed Mar 26, 2014 2:42 am

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.
You do not have the required permissions to view the files attached to this post.
B
25
S
5
G
3
Posts: 446
Reputation: 5,633

Post » Wed Mar 26, 2014 4:04 pm

Wow, forum is busy, so doing a bump. Can't fathom this one out myself, or find anything relating to it :(
B
25
S
5
G
3
Posts: 446
Reputation: 5,633

Post » Wed Mar 26, 2014 11:13 pm

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?
B
11
S
2
G
1
Posts: 79
Reputation: 842

Post » Wed Mar 26, 2014 11:36 pm

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.
B
25
S
5
G
3
Posts: 446
Reputation: 5,633


Post » Wed Nov 12, 2014 10:43 pm

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.
B
25
S
5
G
3
Posts: 446
Reputation: 5,633


Return to How do I....?

Who is online

Users browsing this forum: marcinkowski, Yahoo [Bot] and 4 guests