Scrolling text -- like movie credits

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: Klaus, FourthWorld, heatherlaine, kevinmiller

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 652
Joined: Thu Nov 13, 2008 6:48 am
Location: London, UK

Scrolling text -- like movie credits

Post by marksmithhfx » Tue Nov 24, 2020 5:00 pm

Anyone have a suggestion for scrolling a list of text items (like movie credits) vertically across a blank card... ok, I suppose I'll need a container but haven't decided if one is better than another. I'd probably want it to be invisible anyway (no borders etc).

Thanks
macOS 10.15.7, Xcode 11.5, LC 9.6.1, iOS 13.6.1
Targets: Mac, iOS

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5242
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Scrolling text -- like movie credits

Post by richmond62 » Tue Nov 24, 2020 5:49 pm

vertically across a blank card
Presumably you mean vertically UP a blank card?

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

Re: Scrolling text -- like movie credits

Post by FourthWorld » Tue Nov 24, 2020 6:02 pm

The scroll of a field can still be set even if the scrollbar properties are turned off.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5242
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Scrolling text -- like movie credits

Post by richmond62 » Tue Nov 24, 2020 8:07 pm

scroll1.jpg
-
This one "scrolls" an image of text/

https://www.dropbox.com/s/63d2bsw2sz2o9 ... e.zip?dl=0

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5242
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Scrolling text -- like movie credits

Post by richmond62 » Tue Nov 24, 2020 8:17 pm

This one does exactly the same but with a text field, and comes in at less than 1%
of the size of the former.

Code: Select all

on mouseUp
   set the top of fld "REP" to 10
   put the bottom of fld "REP" into BUM
   repeat until BUM < 1
      set the bottom of fld "REP" to BUM
      subtract 1 from BUM
      wait 2 ticks
   end repeat
end mouseUp
Rocket science. 8)
Attachments
Scrolling Text 2.livecode.zip
Here's the stack.
(2.64 KiB) Downloaded 16 times

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

Re: Scrolling text -- like movie credits

Post by dunbarx » Tue Nov 24, 2020 9:37 pm

A little more compact:

Code: Select all

on mouseUp
   repeat until the scroll of fld 1 >=  (the number of lines of fld 1 * the textHeight of fld 1)  - the height of fld 1
      set the scroll of fld 1 to the scroll of fld 1 + 1
      wait 1 millisec --your call here
   end repeat
end mouseUp
Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5242
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Scrolling text -- like movie credits

Post by richmond62 » Wed Nov 25, 2020 2:39 pm

scrollBonkers.jpg
-
Had some wild dreams last night.

Code: Select all

on mouseUp
   put fld "REP2" into fld "REP"
   do rowSCALE
   put 1 into WIPEOUT
   repeat until WIPEOUT > 50
      delete line 1 of fld "REP"
      do rowSCALE
      add 1 to WIPEOUT
      --wait 1 tick
   end repeat
end mouseUp

on rowSCALE
put 1 into RROW
repeat until RROW > 50
   set the textSize of line RROW of fld "REP" to (RROW + 7)
   add 1 to RROW
end repeat
end rowSCALE
Disclaimer: George Lucas was not involved in the making of this stack in any way whatsoever. 8)
Attachments
Scrolling Text 3.livecode.zip
Here's the stack.
(3.1 KiB) Downloaded 21 times

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

Re: Scrolling text -- like movie credits

Post by dunbarx » Wed Nov 25, 2020 2:59 pm

That is adorable, Richmond. :D

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5242
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Scrolling text -- like movie credits

Post by richmond62 » Wed Nov 25, 2020 3:03 pm

That is adorable,
It might be if it weren't so jerky.

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

Re: Scrolling text -- like movie credits

Post by dunbarx » Wed Nov 25, 2020 4:38 pm

Ah.
It might be if it weren't so jerky.
I didn't actually run it. Lets play around for a bit...

Craig

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

Re: Scrolling text -- like movie credits

Post by dunbarx » Wed Nov 25, 2020 5:17 pm

Richmond.

Tried a few experiments.

There is an intrinsic problem with doing this in a single field, in that If I set the "fixedLineHeight" to true, or set the textSize of a particular line, LC adjusts the visible text to accommodate those property changes. This always appears as jerkiness, whether I then scroll the field or whatever.

Thinking...

Craig
Last edited by dunbarx on Wed Nov 25, 2020 5:37 pm, edited 1 time in total.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5242
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Scrolling text -- like movie credits

Post by richmond62 » Wed Nov 25, 2020 5:23 pm

Want to try this?
-
BIB.jpg
-
No!

Busy building bookshelves. 8)
a stack of fields
Strewth! Give me strength.

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

Re: Scrolling text -- like movie credits

Post by dunbarx » Wed Nov 25, 2020 5:40 pm

I had thought of a stack of fields, each with its own text properties, and loaded field by field (line by line) from below with the contents of some source text. Not sure this would be any smoother.

I think scrolling is required. Just trying to smooth it with all the other shenanigans going on.

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5242
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Scrolling text -- like movie credits

Post by richmond62 » Wed Nov 25, 2020 5:45 pm

Those bookshelves seem to get more and more %^&*()
the higher I climb on the ladder, but it is in fact an illusion as the tape measure
rarely lies.

AND, should you think that that has no relevance to the matter under consideration, think again. 8)

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

Re: Scrolling text -- like movie credits

Post by jacque » Wed Nov 25, 2020 5:53 pm

Just butting in to remark that all solutions so far will lock up the CPU until the repeat completes. Add a "with messages" or, better, use "send in time".
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”