swipes

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bdtrauma
Posts: 34
Joined: Fri Dec 24, 2010 11:37 pm

swipes

Post by bdtrauma » Thu Dec 30, 2010 5:25 am

Does anyone know if finger swipes to move from one card to another are supported in the iOS deployment or is that one of the features 'visual effects' that is not supported yet.

Thanks,

Bert

splash21
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 369
Joined: Sun Dec 19, 2010 1:10 am
Contact:

Re: swipes

Post by splash21 » Thu Dec 30, 2010 10:53 am

Try something like recording the mouse location on a touchStart then checking the horizontal distance moved on touchMove events. You can initiate the swipe when enough distance has been covered.

JC
LiveCode Development & Training : http://splash21.com

ctflatt
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 243
Joined: Sun Dec 06, 2009 12:24 am
Contact:

Re: swipes

Post by ctflatt » Sun Jan 02, 2011 3:05 am

splash21:

What would this code look like?

:Todd

splash21
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 369
Joined: Sun Dec 19, 2010 1:10 am
Contact:

Re: swipes

Post by splash21 » Sun Jan 02, 2011 3:00 pm

Example stack attached - you can adjust the required timing and distance to initiate the swipe.
:D


P.S. I just checked touch messages (not mouse), so you'll need to run it in the simulator or on a device.
Attachments
swipe.livecode.zip
Swipe
(2.25 KiB) Downloaded 526 times
LiveCode Development & Training : http://splash21.com

bdtrauma
Posts: 34
Joined: Fri Dec 24, 2010 11:37 pm

Re: swipes

Post by bdtrauma » Sun Jan 02, 2011 8:24 pm

Nice... this is exactly what I need. Great example. Thanks Splash21

Bert

ctflatt
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 243
Joined: Sun Dec 06, 2009 12:24 am
Contact:

Re: swipes

Post by ctflatt » Mon Jan 03, 2011 2:58 am

Most appreciated! Thanks for your time.

pshuster
Posts: 9
Joined: Thu Apr 19, 2012 11:22 pm

Re: swipes

Post by pshuster » Thu May 24, 2012 9:46 pm

Your stack does exactly what I need. - it works great THANKS!!!!

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: swipes

Post by Mag » Mon Sep 09, 2013 3:22 pm

Hi splash21, thank you so much for the useful stack.

Anyway often the swipe is implemented in some cases (for example in iPhone Camera app) with the content that follow the fingers (a sort of grab) and, when a certain amount of movement is done or not:

1. the content item backs to original position or
2. go to the next item.

Somebody know how could be implemented it with LC? I would like to use it for browse photos.

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: swipes

Post by Mag » Tue Sep 17, 2013 4:36 pm

Ok, I created this code to simulate a bounce, maybe could be useful to some other

Code: Select all

on mouseUp
   put the first item of the loc of image 1 into a
   put the second item of the loc of image 1 into b
   
   move image 1 to (a+30,b) in 8 ticks
   move image 1 to (a,b) in 14 ticks
end mouseUp

Post Reply