Swiping left and right in LC 6.5
Moderators: LCNeil, heatherlaine, kevinmiller, elanorb
Swiping left and right in LC 6.5
I have used the following code in my stack and it works great. When I add the script to scale(fullScreenMode = exact fit) to ipad it doesn't work anymore. Any idea why it stopped working?
# the event id and initial swipe time and position
local sTouchId, sInitTime, sInitX
# maximum swipe time in millisecs
local sSwipeTime
# minimum swipe distance
local sSwipeDistance
on openStack
# set up swipe values - experiment with these for required effect
put 500 into sSwipeTime
put 150 into sSwipeDistance
end openStack
on touchMove pId, pX, pY
if pId <> sTouchId then
# record initial values for start of swipe
put pId into sTouchId
put the millisecs into sInitTime
put pX into sInitX
end if
# check the action was fast enough for a swipe
if the millisecs - sInitTime <= sSwipeTime then
# check we have covered enough distance
put pX - sInitX into tDistanceX
if abs(tDistanceX) > sSwipeDistance then
if tDistanceX < 0 then
# finger is swiping left
send "swipeLeft" to me in 0 millisecs
else
# finger is swiping right
send "swipeRight" to me in 0 millisecs
end if
end if
end if
end touchMove
command swipeLeft
visual effect scroll left normal
go next card
end swipeLeft
command swipeRight
visual effect scroll right normal
go prev card
end swipeRight
# the event id and initial swipe time and position
local sTouchId, sInitTime, sInitX
# maximum swipe time in millisecs
local sSwipeTime
# minimum swipe distance
local sSwipeDistance
on openStack
# set up swipe values - experiment with these for required effect
put 500 into sSwipeTime
put 150 into sSwipeDistance
end openStack
on touchMove pId, pX, pY
if pId <> sTouchId then
# record initial values for start of swipe
put pId into sTouchId
put the millisecs into sInitTime
put pX into sInitX
end if
# check the action was fast enough for a swipe
if the millisecs - sInitTime <= sSwipeTime then
# check we have covered enough distance
put pX - sInitX into tDistanceX
if abs(tDistanceX) > sSwipeDistance then
if tDistanceX < 0 then
# finger is swiping left
send "swipeLeft" to me in 0 millisecs
else
# finger is swiping right
send "swipeRight" to me in 0 millisecs
end if
end if
end if
end touchMove
command swipeLeft
visual effect scroll left normal
go next card
end swipeLeft
command swipeRight
visual effect scroll right normal
go prev card
end swipeRight
Re: Swiping left and right in LC 6.5
Hi Mark,
I have tested your script in LiveCode 6.5 RC3 with the scale mode set to "exact fit" and, for me, it still works as expected.
Please see the attached sample stack that should show this working.
If you still experience the issue after trying the sample stack, please get back in touch and we will happily investigate further
Kind Regards,
Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
LiveCode – Realize fast, compile-free coding
--
I have tested your script in LiveCode 6.5 RC3 with the scale mode set to "exact fit" and, for me, it still works as expected.
Please see the attached sample stack that should show this working.
If you still experience the issue after trying the sample stack, please get back in touch and we will happily investigate further
Kind Regards,
Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
LiveCode – Realize fast, compile-free coding
--
- Attachments
-
- moveTEst.livecode.zip
- (2.06 KiB) Downloaded 228 times
Re: Swiping left and right in LC 6.5
I tested your sample stack and it works great. I made a simple change to my stack. I put the script of fullScreenMode into openStack instead of preOpenStack. The swiping works now. I am still having issues with my cards not scaling right. The 1st card scales fine, but the rest of the cards don't scale right. Everything is in the bottom left hand corner. what am I doing wrong?
Re: Swiping left and right in LC 6.5
This could be a bug that you are experiencing especially with 6.5. not being an official release yet.
If you send me you stack, I will be able to investigate the issue and advise further.
Kind Regards,
Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
LiveCode – Realize fast, compile-free coding
--
If you send me you stack, I will be able to investigate the issue and advise further.
Kind Regards,
Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
LiveCode – Realize fast, compile-free coding
--
Re: Swiping left and right in LC 6.5
Hi Mark,
This looks like a bug related to mobGui.
If you replace all of the preOpenCard handlers that mobGui creates with openCard then your stack should work as expected.
I will be reporting this bug to our quality control team who should be able to investigate it further.
http://quality.runrev.com/show_bug.cgi?id=11448
Kind Regards,
Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
LiveCode – Realize fast, compile-free coding
--
This looks like a bug related to mobGui.
If you replace all of the preOpenCard handlers that mobGui creates with openCard then your stack should work as expected.
I will be reporting this bug to our quality control team who should be able to investigate it further.
http://quality.runrev.com/show_bug.cgi?id=11448
Kind Regards,
Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
LiveCode – Realize fast, compile-free coding
--
Re: Swiping left and right in LC 6.5
Neil:
Thanks for your help. I also, noticed on lower case letters like "g,y,and j" the bottom part of the letter is cut off. Any idea what is going on?
Thanks for your help. I also, noticed on lower case letters like "g,y,and j" the bottom part of the letter is cut off. Any idea what is going on?
Re: Swiping left and right in LC 6.5
Hi Mark,
This again could be a bug in 6.5. Could you supply a screenshot of the issue and If needed, I will submit a bug report on the issue.
Kind Regards,
Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
LiveCode – Realize fast, compile-free coding
—
This again could be a bug in 6.5. Could you supply a screenshot of the issue and If needed, I will submit a bug report on the issue.
Kind Regards,
Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
LiveCode – Realize fast, compile-free coding
—
Re: Swiping left and right in LC 6.5
It was fixed when I upgraded to 6.5 rc4.
Thanks for your help
Thanks for your help
Re: Swiping left and right in LC 6.5
I am using the following script to swipe left and right. It worked after upgrading to LC 6.5. Now with LC 6.5.1 only the top right corner will switch cards. Is there something I am doing wrong? I have also tried to use the script that is in the swiping lesson, but I couldn't get it to work either.
Code: Select all
# the event id and initial swipe time and position
local sTouchId, sInitTime, sInitX
# maximum swipe time in millisecs
local sSwipeTime
# minimum swipe distance
local sSwipeDistance
on openStack
# set up swipe values - experiment with these for required effect
set the fullScreenMode of this stack to "exactFit"
put 400 into sSwipeTime
put 100 into sSwipeDistance
end openStack
on touchMove pId, pX, pY
if pId <> sTouchId then
# record initial values for start of swipe
put pId into sTouchId
put the millisecs into sInitTime
put pX into sInitX
end if
# check the action was fast enough for a swipe
if the millisecs - sInitTime <= sSwipeTime then
# check we have covered enough distance
put pX - sInitX into tDistanceX
if abs(tDistanceX) > sSwipeDistance then
if tDistanceX < 0 then
# finger is swiping left
send "swipeLeft" to me in 0 millisecs
else
# finger is swiping right
send "swipeRight" to me in 0 millisecs
end if
end if
end if
end touchMove
command swipeLeft
--visual effect scroll left normal
go next card
end swipeLeft
command swipeRight
--visual effect scroll right normal
go prev card
end swipeRight
Re: Swiping left and right in LC 6.5
Hi Mark,
I just created a new stack with your script and the swiping works as expected when navigating between cards.
if possible, could you supply a sample script and we will be able to investigate the issue further.
Kind Regards,
Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
—
I just created a new stack with your script and the swiping works as expected when navigating between cards.
if possible, could you supply a sample script and we will be able to investigate the issue further.
Kind Regards,
Neil Roger
--
RunRev Support Team ~ http://www.runrev.com
—