Card Transitions

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
chelling
Posts: 100
Joined: Tue Mar 06, 2007 3:14 am

Card Transitions

Post by chelling » Tue Jun 03, 2014 4:27 pm

I am trying to use mobileClearTouches on closeCard, but it breaks the visual effect curl up. All the other iOS compatible transitions work OK, but I don't think they are appropriate for this app. Does anyone know how to make these both work? Thanks!

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Card Transitions

Post by Mark » Wed Jun 11, 2014 2:19 pm

Hi,

This looks like a LiveCode bug. Could you post the relevant part of your script?

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

chelling
Posts: 100
Joined: Tue Mar 06, 2007 3:14 am

Re: Card Transitions

Post by chelling » Thu Jun 12, 2014 12:51 am

Hi Mark,

I am really interested to see what you think. These are the relevant scripts:

This is the closeCard handler in the stack script.

on closeCard
global gCorrectAnswer, gAnswerCount, gcurrentPercentage, gFirstBtn, gLastBtn
set the defaultFolder to specialFolderPath("Documents")
put field "MLUfield" of card "Data Card" into item 1 of line 49 of field "prefsField" of card "prefsCard"
put gCorrectAnswer into item 1 of line 52 of field "prefsField" of card "prefsCard"
put gAnswerCount into item 1 of line 53 of field "prefsField" of card "prefsCard"
put gcurrentPercentage into item 1 of line 54 of field "prefsField" of card "prefsCard"
put gFirstBtn into item 1 of line 55 of field "prefsField" of card "prefsCard"
put gLastBtn into item 1 of line 56 of field "prefsField" of card "prefsCard"
put the short name of this card into tCard
put tCard into item 1 of line 58 of field "prefsField" of card "prefsCard"
unmark this card
send "ListMarkedCards" to me in 20
saveUserData
pass closeCard
end closeCard

The card are also calling this transition script:

on goNextMkdCd
if the sound is not done then wait until the sound is done
if the cGestureSetting of this stack = "manualadvance" then exit goNextMkdCd
else
if the number of marked cards < 1 then
wait until the sound is done --with/without messages didn't make a difference
visual effect curl up
wait 10
go to card "Data Card"
else
visual effect curl up
go next marked card
end if
end if
end goNextMkdCd


The work around was to add the iPhonecleartouches to each card's openCard handler:

on openCard
playSpeech --this plays an instructional prompt
if the environment is "mobile" then iphoneClearTouches
if the cEnableScan of this stack is true then
initScan 0
put the cScanRate of this stack into temp
wait 28 with messages
if the cScanType of this stack is "stepScan" then
addScanLine "1276,1277,1278,1282,1288,1279,1280,1281,1283,1290,1284,1285,1286,1287,1289"
startScan(0,0,1,3)
else
if the cScanType of this stack is "linear" then
addScanLine "1276,1277,1278,1282,1288,1279,1280,1281,1283,1290,1284,1285,1286,1287,1289"
startScan(temp,0,1)
else
if the cScanType of this stack is "rcScan" then
addScanLine "1276,1277,1278,1282,1288"
addScanLine "1279,1280,1281,1283,1290"
addScanLine "1284,1285,1286,1287,1289"
startScan(temp,0,1)
end if
end if
end if
end if
end openCard

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Card Transitions

Post by Mark » Thu Jun 12, 2014 12:56 am

So, it's been solved now?

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

chelling
Posts: 100
Joined: Tue Mar 06, 2007 3:14 am

Re: Card Transitions

Post by chelling » Thu Jun 12, 2014 3:55 am

I wouldn't call it solved. I moved iphonecleartouches to openCard, and that preserved the trancpsition. I really needed to have it on closeCard, so if a kid was banging on the screen, which they do, the touch messages cleared.
Adding iphonecleartouches to close card prevented the visual effect. This was only with curl up/ down effects. The other transitions - like dissolve - worked with iphoneclear touches in closeCard.

Post Reply