How do I Pinch to ZOOM?

Get help using Construct 2

Post » Thu Apr 16, 2015 2:17 am

Hello everyone, i would really like to know how to pinch to zoom, i know there is already an example capx that shows how to do panning and pinch to zoom, but i only need the pinch to zoom feature and not the panning. and in that capx, the panning and the zoom are togheter using same variables and events.

does someone have another example capx?
Image

Image
B
38
S
14
G
7
Posts: 408
Reputation: 8,338

Post » Thu Apr 16, 2015 3:02 am

You would just do scale to clamp(distance(touch1, touch2)*modifier),min, max) when you have the second touch.
Image ImageImage
B
172
S
50
G
183
Posts: 8,443
Reputation: 115,605

Post » Fri Apr 17, 2015 10:56 pm

can you please submit a example capx? please
Image

Image
B
38
S
14
G
7
Posts: 408
Reputation: 8,338

Post » Fri Apr 17, 2015 11:47 pm

Image ImageImage
B
172
S
50
G
183
Posts: 8,443
Reputation: 115,605

Post » Sat Apr 18, 2015 2:04 am

oh i just downloaded the capx, its work weird on my phone, its there any way to zoom out?
Image

Image
B
38
S
14
G
7
Posts: 408
Reputation: 8,338

Post » Sat Apr 18, 2015 2:58 am

Yes, thats all it does.
It scales up, and back to the distance of the pinch, which of course can't go negative.
Image ImageImage
B
172
S
50
G
183
Posts: 8,443
Reputation: 115,605

Post » Thu May 19, 2016 5:45 pm

@newt Hey how to make zoom out? Zoom in is working great, though.
B
24
S
7
Posts: 337
Reputation: 2,224

Post » Thu May 19, 2016 7:48 pm

I changed the original to an alternate method.
Image ImageImage
B
172
S
50
G
183
Posts: 8,443
Reputation: 115,605

Post » Sat Jun 04, 2016 5:11 pm

now Construct 2 brings a capx file that is a zoom example using touch
Image

Image
B
38
S
14
G
7
Posts: 408
Reputation: 8,338


Return to How do I....?

Who is online

Users browsing this forum: Ryan Kocourek and 15 guests