Running string

Tips and Tricks from the Rainmeter Community
User avatar

Re: Running string

August 13th, 2015, 4:28 pm
balala
Rainmeter Sage   [6464 posts]

Because the last code posted above is almost three years old and in the meantime Rainmeter got a lot of improvements (and I also accumulated a lot of experience), I totaly rebuilt the code:

Code: Select all

[Metadata]
Name=Running string
Description=Demonstrate how can be created a running string

[Rainmeter]
Author=balala (blaci75@gmail.com)
Update=100
MouseActionCursor=1

[Variables]
Txt=Naruto Desktop
Speed=1

;----------------------------------------

[TextStyle]
FontSize=16
FontFace=Stagnation BRK
StringStyle=BOLD
StringAlign=LEFT
StringEffect=SHADOW
AntiAlias=1
Text=#Txt#

[MeterText]
Meter=String
MeterStyle=TextStyle
X=[MeasureX]
Y=0
W=[BinActionWidth]
H=[MeasureTextWidth:H]
FontColor=0,0,0
FontEffectColor=255,255,255
DynamicVariables=1

[MeasureTextWidth]
Meter=String
MeterStyle=TextStyle
X=0
Y=0
FontColor=0,0,0,0
SolidColor=0,0,0,1
FontEffectColor=255,255,255,0

[MeasureTimer]
Measure=Calc
Formula=(( MeasureTimer + #Speed# ) % ( 2 * [MeasureTextWidth:W] ))
DynamicVariables=1

[MeasureX]
Measure=Calc
Formula=( MeasureTimer - [MeasureTextWidth:W] )
DynamicVariables=1

[BinActionWidth]
Measure=Calc
Formula=(( MeasureX > 0 ) ? ( [MeasureTextWidth:W] - MeasureX ) : [MeasureTextWidth:W] )
DynamicVariables=1

This code don't need the TextWidth and SkinWidth variables, it determins them automaticaly. But now I added a Speed variable, which controls the speed of the string.
Please let me know if this code match your needs.
Attachments
Slideshow.gif

Re: Running string

August 21st, 2015, 6:35 pm
drakulaboy
   [165 posts]

awesome balala, add AverageSize to have some smooth letter move? ;-)
User avatar

Re: Running string

August 21st, 2015, 7:20 pm
balala
Rainmeter Sage   [6464 posts]

Yes, you can try to see what's happening.

Return to “Community Tips and Tricks”



Who is online

Users browsing this forum: No registered users and 1 guest