Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: A code to scroll ...? (Read 6410 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

A code to scroll ...?

Has somebody got a code to get text scrolled (horizontaly) in a given "Window" (e.g. 10 letters length) ...??
Or is it impossible ?? (I realy hope its not)

.THNX.

A code to scroll ...?

Reply #1
Yes, they have. I saw it in the foo_infopanel thread awhile ago, but it has grown to many pages since.

 

A code to scroll ...?

Reply #2
this:

$puts(len,40)
$puts(title,$if2(%title%,%_filename_ext%))
$iflonger($get(title),$get(len),
$puts(diff,$sub($len($get(title)),$get(len)))
$puts(start,$add(1,$mod(%_time_elapsed_seconds%,$get(diff))))
$puts(start2,$select($add($div($add(1,$mod( %_time_elapsed_seconds%,$mul($get(diff),2))),$add($get(diff),1)),1),$get(start),$sub($add($get(diff),1),$get(start))))
$substr($get(title),$get(start2),$add($get(start2),$get(len)))
,$get(title))

should do the trick. len,40 is the desired length, here 40.

A code to scroll ...?

Reply #3
Dank U Well ...!! 

A code to scroll ...?

Reply #4
what if one should want to put in different information?
i had mine displaying this:
[%artist% - ]['['%album%[ CD%discnumber%][ #%tracknumber%]']']%title%  %playback_time_remaining%

before i tried this whole scrolling bit, i figured trying to put it into the second $puts line would get me where i was going, like this:
$puts(title,$if2(%artist%,%album%,%discnumber%,%tracknumber%,%title%,%playback_time_remaining%))

but that just keeps returning:
[INVALID $IF2 SYNTAX]

any ideas?
-Live Long and Prosper

A code to scroll ...?

Reply #5
As the error indicates, you are not using $if2() properly.. you have way too many parameters.  Is this what you are trying to accomplish?
Code: [Select]
$puts(title,$if2([%artist% - ]['['%album%[ CD%discnumber%][ #%tracknumber%]']']%title% %playback_time_remaining%,%_filename_ext%))

A code to scroll ...?

Reply #6
Well, now I came to a point were I want to modify kuru's code (see above) a little bit ... 
... but my little brainy is too small to do it !! 

---> In detail:
Has anybody an idea, how I can make it that it "freezes" at its starting-position for x seconds ...??

.THNX.

A code to scroll ...?

Reply #7
Well, now I came to a point were I want to modify kuru's code (see above) a little bit ... 
... but my little brainy is too small to do it !! 

---> In detail:
Has anybody an idea, how I can make it that it "freezes" at its starting-position for x seconds ...??

.THNX.
Just see the code for home stereo panel,the scrolling there freezes for 2 sec at the beginning.
Favourite artist:CD-R
Favourite album:700MB

A code to scroll ...?

Reply #8
ahm ... 
... you cant expect me to understand your LCD-Display !! 

PLEASE, can you (or s.o. else) modify the code above or gimme a "ready2use-script" ...??


.THNX.

A code to scroll ...?

Reply #9
ahm ... 
 ... you cant expect me to understand your LCD-Display !! 

PLEASE, can you (or s.o. else) modify the code above or gimme a "ready2use-script" ...??


.THNX.
A very simplified version:
Code: [Select]
$puts(window,22)
$puts(scrollback,1)
$puts(delay,6)
$puts(font,arial,9,,)
$puts(title,['"'%title%'"'][ - %artist%]['/'%album%] ['('%date%')'])

$get(active)
$if($greater($len($get(title)),$get(window)),
$puts(shift,$sub($len($get(title)),$get(window)))
$if($get(scrollback),
$puts(mod,$mod(%_time_elapsed_seconds%,$add($mul($get(shift),2),$sub($get(delay),1))))
$if($greater($get(delay),$get(mod)),$substr($get(title),1,$get(window)),
$puts(mod,$sub($get(mod),$sub($get(delay),1)))$puts(flag,$get(mod))
$if($greater($add($get(shift),1),$get(mod)),
$substr($get(title),$add(1,$get(mod)),$add($get(window),$get(mod))),
$substr($get(title),$sub($mul($get(shift),2),$get(mod),-1),
$add($get(window),$sub($mul($get(shift),2),$get(mod),0))))),
$puts(mod,$mod(%_time_elapsed_seconds%,$add($mul($get(shift),2),$sub($get(delay),1))))
$if($greater($get(delay),$get(mod)),$substr($get(title),1,$get(window)),
$puts(mod,$sub($get(mod),$sub($get(delay),1)))
$substr($get(title),$add(1,$get(mod)),$add($get(window),$get(mod))))),
$align(center,middle)
$get(title))

Just replace the "$get(active)" to your color definition and the "title"-to your text
Favourite artist:CD-R
Favourite album:700MB