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
37
S
14
G
7
Posts: 406
Reputation: 8,309

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
166
S
49
G
154
Posts: 8,108
Reputation: 100,237

Post » Fri Apr 17, 2015 10:56 pm

can you please submit a example capx? please
Image

Image
B
37
S
14
G
7
Posts: 406
Reputation: 8,309

Post » Fri Apr 17, 2015 11:47 pm

Image ImageImage
B
166
S
49
G
154
Posts: 8,108
Reputation: 100,237

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
37
S
14
G
7
Posts: 406
Reputation: 8,309

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
166
S
49
G
154
Posts: 8,108
Reputation: 100,237

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: 330
Reputation: 2,210

Post » Thu May 19, 2016 7:48 pm

I changed the original to an alternate method.
Image ImageImage
B
166
S
49
G
154
Posts: 8,108
Reputation: 100,237

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
37
S
14
G
7
Posts: 406
Reputation: 8,309


Return to How do I....?

Who is online

Users browsing this forum: ismael123, Markowicz and 2 guests