Creating live sliding cards... possible?

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

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

Creating live sliding cards... possible?

Post by ctflatt » Tue Aug 09, 2011 12:41 pm

I am trying to achieve a live sliding card effect for both directions, where from a current card using touch gestures a user can slide right or left without using the push visual effect. From the given card, the view of the previous and next cards would need to be available for a live slide either way.

Is this possible without using transitions? If so, could someone get me started?

Does this even make sense? LOL.

Many thanks!

Todd

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: Creating live sliding cards... possible?

Post by Jellicle » Tue Aug 09, 2011 1:54 pm

I can think of a way, but having gone up that path recently I'm not willing to subject you to the pain it involves...and no, it isn't worth it! Hopefully future updates to LC will bring graphics processing speed gains, and we'll also get better performing scroller objects. Both those thing would make my idea workable.

Gerry

PS How many cards in total?
14" MacBook Pro
Former LiveCode developer.
Now recovering.

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

Re: Creating live sliding cards... possible?

Post by ctflatt » Tue Aug 09, 2011 2:14 pm

Gerry:

Thanks for the reply... I started thinking about generating card snapshots on the fly and then replacing them with actual card navigated with no transition, but then my head started spinning, and... LOL...

:Todd

brentj84062
Posts: 18
Joined: Wed Jul 12, 2006 4:40 am

Re: Creating live sliding cards... possible?

Post by brentj84062 » Wed Aug 17, 2011 9:01 pm

While not the most elegant solution, you could first detect swiping touch motions for left or right swipes on the current card. That would trigger a screenshot of the current card which would then be placed on the card the user will be going to. You immediately jump to that card (no transition) and then use a move command to move the screenshot off screen with the desired animated effect. Purge the screenshot when finished to keep things clean.

I haven't tried this, that's just what comes to mind when I think of the solution you are looking for.

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

Re: Creating live sliding cards... possible?

Post by ctflatt » Thu Aug 18, 2011 3:21 pm

Thanks. That's kind of what I've done.

After thinking about the problem, I created a native scroller that places the preceding/following cards as snapshots into position on a preOpenCard handler. The snapshots are generated fresh with each preOpenCard call as a stack script. I have a go to card script in the scrollerDidScroll handler, which replaces the snapshot with the actual card with no visible transition.

The performance is really pretty good.

Thanks for the input!

Todd

oceanatlas
Posts: 3
Joined: Thu Sep 06, 2012 8:46 pm

Re: Creating live sliding cards... possible?

Post by oceanatlas » Sun Sep 16, 2012 6:45 am

I'm new to the forums and found this thread while poking around. Can you share code for how to make this work? I'm an experienced programmer but I have not worked with scrollers before. Also, will this technique work under iOS? TIA

endernafi
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 296
Joined: Wed May 02, 2012 12:23 pm
Contact:

Re: Creating live sliding cards... possible?

Post by endernafi » Mon Sep 24, 2012 2:22 am

Hi,

I assume you want a visual construct like the homepage of TvShowTracker app:
http://itunes.apple.com/us/app/tv-show- ... 65283?mt=8

So, how about using groups instead of cards and a native iOS scroller control?
Check out my stack for a simple implementation:
liveCardChange.zip
(5.11 KiB) Downloaded 402 times

Regards,

~ Ender Nafi Elekcioglu
~... together, we're smarter ...~
__________________________________________

macOS Sierra • LiveCode 7 & xCode 8

scotttyang
Posts: 125
Joined: Sat Jan 31, 2009 12:01 am

Re: Creating live sliding cards... possible?

Post by scotttyang » Thu Oct 04, 2012 5:51 pm

basically, make 1 card.

use the scroller horizontal scroller

you have to create a group with 3 fields side by side by side horizontally to the size of your card.

scroll horizontally side to side. that simulates the "card" transitioning even though your in one card.

so when the card is open, the middle field is visible. this allow you to slide right and left.

Once you slide Right lets say, then, you have to LOCK SCREEN. then put the content of the 1st field, into the 2nd field. then set the position of the scroll of the middle (2nd field) to (1025) and unlock screen.

do similar when you slide or swipe left.

I'm sure I have a stack someplace with that effect

Post Reply