Page 2 of 2

Re: Running string

Posted: August 13th, 2015, 4:28 pm
by balala
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.

Re: Running string

Posted: August 21st, 2015, 6:35 pm
by drakulaboy
awesome balala, add AverageSize to have some smooth letter move? ;-)

Re: Running string

Posted: August 21st, 2015, 7:20 pm
by balala
Yes, you can try to see what's happening.