Continuous scrolling field

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
trags3
Posts: 418
Joined: Wed Apr 09, 2014 1:58 am
Location: Las Vegas, NV

Continuous scrolling field

Post by trags3 » Tue Feb 15, 2022 7:02 pm

I need to be able to have a field that I can have the user paste a news story or two into and then have it continuously scroll so it can be read and start over when the bottom has been reached.
I know this must be possible but how?
Getting back into LC after a brief hiatus.
Tom

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2718
Joined: Sat Dec 22, 2007 5:35 pm
Location: Genève
Contact:

Re: Continuous scrolling field

Post by jmburnod » Tue Feb 15, 2022 7:38 pm

Hi Tom,
Just a start

Code: Select all

on textchanged
   set the vscroll of fld 1 to 0
   wait 1 seconds
   put the formattedheight of fld 1 into tFH
   repeat with i = 1 to tFH
      if the optionkey is down then exit repeat
      set the vscroll of fld 1 to i
   end repeat
end textchanged
Best regards
Jean-Marc
https://alternatic.ch

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

Re: Continuous scrolling field

Post by dunbarx » Tue Feb 15, 2022 8:36 pm

Just another play...
scrolling reader.livecode.zip
(1.41 KiB) Downloaded 77 times
Craig

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

Re: Continuous scrolling field

Post by dunbarx » Tue Feb 15, 2022 8:39 pm

Probably better to have the user somehow use the cursor inside the scrolling field itself to control the position and rate of the text flow.

How important is any of that gadgetry?

Craig

trags3
Posts: 418
Joined: Wed Apr 09, 2014 1:58 am
Location: Las Vegas, NV

Re: Continuous scrolling field

Post by trags3 » Tue Feb 15, 2022 10:17 pm

There will be maybe 2 or 3 news stories that need to be continuously scrolled without user input. Maybe 2 or 3 times a day someone will either change the stories or add more.
Tom

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

Re: Continuous scrolling field

Post by dunbarx » Tue Feb 15, 2022 10:24 pm

To make this run nicely, it would be better not to jump to the top at the bottom of the current text, which is disconcerting, but rather to present a continuous flow. This means taking text that has already passed upward and out of view, and appending it to the bottom. This can be done in stage hopefully invisibly.

So much fun, assuming this get traction...

Craig

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

Re: Continuous scrolling field

Post by dunbarx » Tue Feb 15, 2022 11:42 pm

So here is a continuous scrolling field that needs no scrollbar, has a speed control, and runs forever.

I do admit that the text itself gets pretty boring after an hour or two.
scrolling reader2.livecode.zip
(2.08 KiB) Downloaded 83 times
Craig

Post Reply

Return to “Talking LiveCode”