Touch Swipe Speed?

Get help using Construct 2

Post » Wed Feb 01, 2012 12:12 pm

Afternoon,

Can you calculate touch swipe speeds?

I want to be able to have smooth swipe gestures like my Samsung Galaxy S Smart Phone! :)2Bdigital2012-02-01 12:14:00
B
5
S
1
G
1
Posts: 111
Reputation: 1,122

Post » Wed Feb 01, 2012 12:33 pm

make an object with three instance variables:
oldX, newX, swipespeed we will calculate horizontal swiping speed and put it into swipespeed in every tick:

is in touch
-- set oldX to newX
-- set newX to touch.X
-- set swipespeed to abs(newX - oldX)

cheers
B
81
S
50
G
10
Posts: 555
Reputation: 13,009

Post » Wed Feb 01, 2012 12:44 pm

Hi Ranma,

Would you be so kind as to incorporate it into this capx file for me?

My Link

Ill understand it better if I see it. Not much of a coder.     
2Bdigital2012-02-01 12:46:01
B
5
S
1
G
1
Posts: 111
Reputation: 1,122

Post » Wed Feb 01, 2012 1:44 pm

http://dl.dropbox.com/u/59009902/body.capx

here you go
B
81
S
50
G
10
Posts: 555
Reputation: 13,009

Post » Wed Feb 01, 2012 2:12 pm

Cheers! Your a star! ;)
B
5
S
1
G
1
Posts: 111
Reputation: 1,122

Post » Wed Feb 01, 2012 3:11 pm

@Ashley

Would it be possible to add speed to the touch object, and drag and drop?
Image Image
B
161
S
48
G
91
Posts: 7,359
Reputation: 67,273

Post » Wed Feb 01, 2012 3:24 pm

That would be useful...

I'm currently trying to tie in Touch Gestures and Swipe Speeds together to create something similar to mobile and tablet devices!
B
5
S
1
G
1
Posts: 111
Reputation: 1,122

Post » Thu Feb 02, 2012 9:40 am

@2Bdigital : I'm not sure, but does the Unistroke Gesture Recognition plugin helps you in that context (by adding a swipe gesture) ?
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Thu Feb 02, 2012 10:39 am

@Pode

I think it does but I've already used Yann's touch gesture example to create this. Might have a look anyway as it may be some help to me.

I need to know how I can combine both a swipe gesture and swipe speed to create something you see on all mobile/tablet devices.

I have an example if anyone wouldn't mind taking a look...
B
5
S
1
G
1
Posts: 111
Reputation: 1,122


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 19 guests