Problem with Touch event

Get help using Construct 2

Post » Mon Nov 14, 2016 5:16 pm

Hi guys i have been trying to simulate swipe effect to use it on a menu for my project.
So far i have had success in stimulating the effect of swiping to the right in order to make my objects change position but i can´t seem to make my objects return to their original position by swiping the screen to the left.
I can´t seem to understand where im going wrong in my events, would appreciate some help.
Here´s the Capx:
https://www.dropbox.com/s/jhgtcvzjw3z3h ... .capx?dl=0

Thanks in advance!
B
26
S
14
G
8
Posts: 49
Reputation: 6,250

Post » Tue Nov 15, 2016 5:08 pm

Anyone?
Could really use some help.
Sorry for bumping the thread.
B
26
S
14
G
8
Posts: 49
Reputation: 6,250

Post » Tue Nov 15, 2016 6:37 pm

If you're simulating swiping you could probably do it by detecting that first touch.x and on release of touch detect whether the new touch.x is less or more than and swipe in the direction. In your current logic you try and set touch.x without any touching (on start of layout) so it's always zero.
B
47
S
18
G
84
Posts: 2,273
Reputation: 49,800

Post » Tue Nov 15, 2016 7:12 pm

So i would have to set up an even like so?
On start of Layout- Set Touch.x to Touch
Is that what you mean?
B
26
S
14
G
8
Posts: 49
Reputation: 6,250

Post » Tue Nov 15, 2016 7:44 pm

On any touch or hold you store the touch x,y, then when they release or on any touch end as its called you test if the touch x is now less or more than the original touch x. I assume if they're swiping left then the x at release will be less than the original touch.
B
47
S
18
G
84
Posts: 2,273
Reputation: 49,800

Post » Tue Nov 15, 2016 7:55 pm

Ok i got it finally jeez thanks for the help im gonna post the capx in case anyone has any difficulty with this as well-
Thanks alot again for the help.
This was nothing more than me not understanding english.
Capx:
https://www.dropbox.com/s/jhgtcvzjw3z3h ... .capx?dl=0

Btw how do i make this thread solved?
B
26
S
14
G
8
Posts: 49
Reputation: 6,250


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 18 guests