|
Pages: [1]
|
 |
|
Author
|
Topic: Horizontal scrolling text (Read 697 times)
|
|
jvvisser
|
Hi! I would like to write a small stand alone script that reads text from a file and scrolls it in a bar like news tickers. How can I get the text to scroll fluidly from right to left. Are there some smart tricks to get the text scrolling? Thank you!!
|
|
|
|
|
Logged
|
|
|
|
|
Gabriele
|
Just to get you started: view layout [ size 300x60 text 2000x24 "Some very looooooooooooooooooooooooooooooooooooooooooooooooong text to scroll and so on and so on and so on......................." rate 25 feel [ engage: func [face action event] [ if action = 'time [ face/offset: face/offset - 1x0 face/changes: 'offset show face ] ] ] ]
|
|
|
|
|
Logged
|
|
|
|
|
jvvisser
|
Thanks a lot!! It works fine, but the memory usage keeps growing slowly, from 10MB on. It seems to never stop, couple of kb each time... It that something I should worry about? Thanks again...
|
|
|
|
|
Logged
|
|
|
|
|
jvvisser
|
Ah well, it stops at 13 MB...
|
|
|
|
|
Logged
|
|
|
|
|
jvvisser
|
Is there an easy way to get it looping when all the text has scrolled? Thanks!!!!
|
|
|
|
|
Logged
|
|
|
|
|
notchent
|
Check if the offset is off screen far enough, then reset it to the starting point (if face/offset = -75x20 [face/offset: 75x20]):
view layout [ size 75x60 at 75x20 text 75x24 "Scrolling text" rate 25 feel [ engage: func [face action event] [ if action = 'time [ if face/offset = -75x20 [face/offset: 75x20] face/offset: face/offset - 1x0 face/changes: 'offset show face ] ] ] ]
|
|
|
|
|
Logged
|
|
|
|
|
|
Pages: [1]
|
|
|
 |