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

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 939
Joined: Thu Nov 13, 2008 6:48 am

Scrolling text -- like movie credits

Post by marksmithhfx »

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 15.6 (Sequola), Xcode 15.3, LC 10.0.2, iOS 18.6.2
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10422
Joined: Fri Feb 19, 2010 10:17 am

Re: Scrolling text -- like movie credits

Post by richmond62 »

vertically across a blank card
Presumably you mean vertically UP a blank card?
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Scrolling text -- like movie credits

Post by FourthWorld »

The scroll of a field can still be set even if the scrollbar properties are turned off.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10422
Joined: Fri Feb 19, 2010 10:17 am

Re: Scrolling text -- like movie credits

Post by richmond62 »

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: 10422
Joined: Fri Feb 19, 2010 10:17 am

Re: Scrolling text -- like movie credits

Post by richmond62 »

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 545 times
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10504
Joined: Wed May 06, 2009 2:28 pm

Re: Scrolling text -- like movie credits

Post by dunbarx »

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: 10422
Joined: Fri Feb 19, 2010 10:17 am

Re: Scrolling text -- like movie credits

Post by richmond62 »

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 567 times
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10504
Joined: Wed May 06, 2009 2:28 pm

Re: Scrolling text -- like movie credits

Post by dunbarx »

That is adorable, Richmond. :D

Craig
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10422
Joined: Fri Feb 19, 2010 10:17 am

Re: Scrolling text -- like movie credits

Post by richmond62 »

That is adorable,
It might be if it weren't so jerky.
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10504
Joined: Wed May 06, 2009 2:28 pm

Re: Scrolling text -- like movie credits

Post by dunbarx »

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: 10504
Joined: Wed May 06, 2009 2:28 pm

Re: Scrolling text -- like movie credits

Post by dunbarx »

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: 10422
Joined: Fri Feb 19, 2010 10:17 am

Re: Scrolling text -- like movie credits

Post by richmond62 »

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: 10504
Joined: Wed May 06, 2009 2:28 pm

Re: Scrolling text -- like movie credits

Post by dunbarx »

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: 10422
Joined: Fri Feb 19, 2010 10:17 am

Re: Scrolling text -- like movie credits

Post by richmond62 »

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: 7423
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Scrolling text -- like movie credits

Post by jacque »

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