Show Card Command

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Hutchboy
Posts: 51
Joined: Wed Aug 01, 2018 2:57 pm
Contact:

Show Card Command

Post by Hutchboy » Wed Aug 01, 2018 3:18 pm

I would like some help understanding how to use the "show card" command properly, especially the variant "show all cards". I've searched the forum and online but haven't found anything relevant.

When I script a button with "on mouseUp show all cards end mouseUp" it either is going through the cards and back to the first so quickly as to be unusable or I am missing how to properly use it. I don't see any modifiers in the command that would let me adjust the speed of display.

I am sure there are other ways to set up a program loop to step through the cards but I am really just trying to understand this simple command and whether there is a useful way to use it it LC.

BTW, I like to convert old hypercard stacks for fun and a button with this script often shows up in HC stacks.

Any advice or examples would be greatly appreciated.

Mike

Klaus
Posts: 13807
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Show Card Command

Post by Klaus » Wed Aug 01, 2018 3:26 pm

Hi Mike,

welcome to the forum!

I never used this command, but essentially it was made to use a stack as some kind of flipbook/animation tool. This has been in LC since version 1 and I guess this is still here for nostalgia. :-)

I guess since this version, which came out in 2001, the machines have actually HEAVILY evolved
and that is the reason we can hardly see any card if issuing this command nowadays.
I am only guessing, but that makes sense to me.


Best

Klaus

Hutchboy
Posts: 51
Joined: Wed Aug 01, 2018 2:57 pm
Contact:

Re: Show Card Command

Post by Hutchboy » Wed Aug 01, 2018 5:01 pm

Klaus,

Thanks for the quick response. I thought that might be the case but hoping that maybe I was missing something in how to use it. Even in HyperCard running on Sheepshaver the show command cycles through the cards extremely fast.

I think I will just find or create an alternate handler with parameters so I can loop through the cards of a stack with a variable delay.

Happy coding,
Mike

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9587
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Show Card Command

Post by dunbarx » Wed Aug 01, 2018 6:00 pm

These commands are indeed from HC, dating to version 1.0. They were used to animate a slideshow. But I do not think that LC supports this command to the extent HC did. For example, you cannot insert a visual effect in the process, so that there is no timing control available. Showing all cards takes only an instant.

Craig Newman

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9804
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Show Card Command

Post by FourthWorld » Wed Aug 01, 2018 8:15 pm

dunbarx wrote:
Wed Aug 01, 2018 6:00 pm
These commands are indeed from HC, dating to version 1.0. They were used to animate a slideshow. But I do not think that LC supports this command to the extent HC did. For example, you cannot insert a visual effect in the process, so that there is no timing control available. Showing all cards takes only an instant.
I don't think HC included options for visual effects with the show command.

According to HyperTalk 2.2: The Book (Winkler, Kamins, DeVoto), the show command only had these options:

Code: Select all

show [numberOfCards|marked|all] cards
On p551 the authors do provide an example of how to use visual effects, but it's done there as Mike proposed above, using a custom handler instead of using the show command.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9587
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Show Card Command

Post by dunbarx » Wed Aug 01, 2018 9:38 pm

Hmmm.

I think you are right.

Craig

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7216
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Show Card Command

Post by jacque » Thu Aug 02, 2018 3:57 pm

I think another difference is that HC managed stacks on disk and LC keeps everything in RAM which runs much faster. Then as machines got faster so did the card display. That's usually an improvement except in cases like this one.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9587
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Show Card Command

Post by dunbarx » Thu Aug 02, 2018 4:35 pm

Jacque.

I made a 100 card stack in HC. Disk management notwithstanding, the "show all cards" command took 15 ticks.

So unless the flip book that one was making required a frame rate 20 times faster than old movies had, it seems that a delay parameter in that command is sorely needed.

Craig

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Show Card Command

Post by capellan » Thu Aug 02, 2018 11:32 pm

Hi Mike,

Mike wrote:
Any advice or examples would be greatly appreciated.
You could download this stack with a card flipbook animation example:
https://drive.google.com/file/d/0B9ja3Y ... Awb1k/view

This stack displays:

1) an animated gif inside a background group
with the Dynamic Layer property set.
Control the Dove position using the keyboard:
QWE
A S
ZXC

2) a 20 cards flip animation that plays
when you press the mouse button
inside the photo or stack background.

In this version, you could use sliders to control the speed
and movement step of the animated gif.

Check the handler runAnim in the stack script.
It uses "go next" to show the next card with a new background image
and "send" to control animation speed.
http://docs.runrev.com/Command/send
http://livecode.byu.edu/time/timeDelay.php

By the way, I have been away for a while from the forums and mail list so:
Does exists a Livecode version of HyperCard's Train set?

https://www.mrericsir.com/blog/personal ... portfolio/

Al
animation stack screenshot.JPG

PaulDaMacMan
Posts: 617
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

Re: Show Card Command

Post by PaulDaMacMan » Thu Nov 30, 2023 2:59 pm

I know this thread is 5 years old, but I just found it and would interject.
ShowAllCards, originating from HyperCard which ran on Moto 68K CPUs at less then 1MHz clock speed, IIRC the command simply visits every card (or range or marked cards only) as if the stack user had navigated to them, which means an 'on openCard' message gets sent by 'the engine' for each card. So to control the speed for 'frames' (cards) of a flip book animation you could put a (back then blocking-only) 'wait' delay in the card's openCard handler (or maybe use a 'background' script to effect all cards with that background, which people who've converted HC to LC know, is equivalent to LC's shared 'Group').
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”