Zoom with mouse scroll

Get help using Construct 2

Post » Mon Mar 19, 2012 11:28 am

how do something like that?
B
170
S
3
G
2
Posts: 65
Reputation: 6,057

Post » Mon Mar 19, 2012 12:24 pm

Insert a mouse object on layer, then capture the scroll-wheel via an event.

If you add sub-events detecting if it's going up or down, then increment zoom based on that.

I'll do an example when I get home if no-one has done in meantime.

Image
B
27
S
9
G
5
Posts: 487
Reputation: 11,939

Post » Thu Mar 22, 2012 1:40 pm

Did you get this working?
Image
B
27
S
9
G
5
Posts: 487
Reputation: 11,939

Post » Thu Mar 22, 2012 3:49 pm

i do something with mouse scroll, change layout size when scroll up 'zoom in 1/2' or scrool down 'zoom out 1/2' But i dont kono how to do smoothly
B
170
S
3
G
2
Posts: 65
Reputation: 6,057

Post » Thu Mar 22, 2012 9:36 pm

I made a quick example, hopefully I didn't make it too complex ahah - it's just got some stuff in there so you can customize the amount of zoom and speed, also to do it smoothly, and a little bit faster if you're rolling the mouse fast.


http://www.johnnysix.net/games/MouseZoom/


http://www.johnnysix.net/games/MouseZoom/MouseZoomExample.capx
Image
B
27
S
9
G
5
Posts: 487
Reputation: 11,939


Return to How do I....?

Who is online

Users browsing this forum: anty21ro, LaroTaio, Radulepy, tarek2, TiagoCesar and 21 guests