It is currently April 24th, 2024, 4:06 pm

How to create crawling text?

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16166
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to create crawling text?

Post by balala »

xenium wrote:Would I like to know if the text can start running from the line to the left edge (not edge to edge) ?
Sorry for being too late, just came back from my holiday.
I'm not sure I understood what you would like. You would like it to start as now, but on the left edge to not enter "below" the yellow frame?
If you're still interested, please give us (me) a few details.
User avatar
xenium
Posts: 866
Joined: January 4th, 2018, 9:52 pm

Re: How to create crawling text?

Post by xenium »

balala wrote:Sorry for being too late, just came back from my holiday.
I'm not sure I understood what you would like. You would like it to start as now, but on the left edge to not enter "below" the yellow frame?
If you're still interested, please give us (me) a few details.
Welcome back! :yahoo:
Now, the text moves from the right edge to the left edge.
I would like, if possible, that the text should start moving from the white vertical line to the left edge.
User avatar
balala
Rainmeter Sage
Posts: 16166
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to create crawling text?

Post by balala »

xenium wrote:I would like, if possible, that the text should start moving from the white vertical line to the left edge.
Probably you should have to use another value for the SkinWidth variable ([Variables] section). SkinWidth=200 seems a proper value, but you have to decide.
Anyway, modifying this variable will require to set explicitly the width of the skin, into the [Rainmeter] section: SkinWidth=300 (instead of SkinWidth=#SkinWidth#).

One single problem I see here: when the string appears it is not revealed step by step, it appears suddenly. For now, no good idea how to deal this...

And another, not extremely important thing I saw in your code: the Author option doesn't belong anymore to the [Rainmeter] section, but to [Metadata]. Once it belonged there, but in the meantime it was deprecated into the [Rainmeter] section and transferred to [Metadata].
User avatar
xenium
Posts: 866
Joined: January 4th, 2018, 9:52 pm

Re: How to create crawling text?

Post by xenium »

balala wrote:Probably you should have to use another value for the SkinWidth variable ([Variables] section). SkinWidth=200 seems a proper value, but you have to decide.
Anyway, modifying this variable will require to set explicitly the width of the skin, into the [Rainmeter] section: SkinWidth=300 (instead of SkinWidth=#SkinWidth#).

One single problem I see here: when the string appears it is not revealed step by step, it appears suddenly. For now, no good idea how to deal this...

And another, not extremely important thing I saw in your code: the Author option doesn't belong anymore to the [Rainmeter] section, but to [Metadata]. Once it belonged there, but in the meantime it was deprecated into the [Rainmeter] section and transferred to [Metadata].
It would have been great if the text did not appear suddenly.
Anyway,thanks for the reply.
User avatar
balala
Rainmeter Sage
Posts: 16166
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to create crawling text?

Post by balala »

xenium wrote:It would have been great if the text did not appear suddenly.
I don't see a good and simple way to do this. If the string would be an image a properly created ImageCrop option could help, but with the strings: :confused:
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5406
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: How to create crawling text?

Post by eclectic-tech »

xenium wrote:It would have been great if the text did not appear suddenly.
Anyway,thanks for the reply.
Use the X position value to control the alpha value of the text meter. I subtract the value of the X position that is close to where the text meets your line, then multiple that value by 6 to quickly increase the font alpha toward 255. The clamp formula keeps it at 255 (full visibility). I changed the shadow to an inlinesetting because the StringEffect approach will create a shadow even if the alpha is zero, while the inline setting works as expected.

Code: Select all

[MeterText]
Meter=String
MeasureName=MeasureName
X=(#SkinWidth#-[MeasureX])
Y=20
FontColor=255,255,255,(Clamp((([MeasureX:]-110)*6),0,255))
FontSize=12
FontFace=Arial
StringStyle=BOLD
StringAlign=LEFT
InlineSetting=Shadow | 2 | 2 | 3.5 | 150,150,150,200
;StringEffect=SHADOW
AntiAlias=1
DynamicVariables=1

alphaX.gif
You do not have the required permissions to view the files attached to this post.
User avatar
xenium
Posts: 866
Joined: January 4th, 2018, 9:52 pm

Re: How to create crawling text?

Post by xenium »

eclectic-tech wrote:Use the X position value to control the alpha value of the text meter. I subtract the value of the X position that is close to where the text meets your line, then multiple that value by 6 to quickly increase the font alpha toward 255. The clamp formula keeps it at 255 (full visibility). I changed the shadow to an inlinesetting because the StringEffect approach will create a shadow even if the alpha is zero, while the inline setting works as expected.

Code: Select all

[MeterText]
Meter=String
MeasureName=MeasureName
X=(#SkinWidth#-[MeasureX])
Y=20
FontColor=255,255,255,(Clamp((([MeasureX:]-110)*6),0,255))
FontSize=12
FontFace=Arial
StringStyle=BOLD
StringAlign=LEFT
InlineSetting=Shadow | 2 | 2 | 3.5 | 150,150,150,200
;StringEffect=SHADOW
AntiAlias=1
DynamicVariables=1

alphaX.gif
Nice solution!
It would be good if the text is small, but if it is longer ....
Test crawling2.zip
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16166
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to create crawling text?

Post by balala »

xenium wrote:It would be good if the text is small, but if it is longer ....
I'd modify the code in a way to make the string to be shown up letter by letter. Although this isn't exactly what would be needed, I think a such approach can somehow simulate what you want:

Code: Select all

[Rainmeter]
Update=100
MouseActionCursor=1
SkinWidth=#SkinWidth#

[Variables]
Speed=3
SkinWidth=300
LetterWidth=8
UpdateRateSeconds=6000
URL=https://www.foreca.com/Canada/Newfoundland_and_Labrador/Happy_Valley-Goose_Bay?tenday
;URL=https://www.foreca.com/France/Paris?tenday

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

[MeasureName]
Measure=WebParser
Url=#URL#
RegExp=(?siU)<h1>(.*)</h1>
UpdateRate=#UpdateRateSeconds#
StringIndex=1

[MeasureX]
Measure=Calc
Formula=( #Speed# * COUNTER % ( #SkinWidth# + [MeterText:W] ))
IfCondition=(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]))
IfTrueAction=[!SetOption MeterText InlinePattern2 "^(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition2=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+#LetterWidth#)))
IfTrueAction2=[!SetOption MeterText InlinePattern2 "^.(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition3=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+2*#LetterWidth#)))
IfTrueAction3=[!SetOption MeterText InlinePattern2 "^..(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition4=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+2*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+3*#LetterWidth#)))
IfTrueAction4=[!SetOption MeterText InlinePattern2 "^...(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition5=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+3*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+4*#LetterWidth#)))
IfTrueAction5=[!SetOption MeterText InlinePattern2 "^....(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition6=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+4*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+5*#LetterWidth#)))
IfTrueAction6=[!SetOption MeterText InlinePattern2 "^.....(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition7=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+5*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+6*#LetterWidth#)))
IfTrueAction7=[!SetOption MeterText InlinePattern2 "^......(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition8=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+6*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+7*#LetterWidth#)))
IfTrueAction8=[!SetOption MeterText InlinePattern2 "^.......(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition9=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+7*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+8*#LetterWidth#)))
IfTrueAction9=[!SetOption MeterText InlinePattern2 "^........(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition10=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+8*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+9*#LetterWidth#)))
IfTrueAction10=[!SetOption MeterText InlinePattern2 "^........(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition11=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+9*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+10*#LetterWidth#)))
IfTrueAction11=[!SetOption MeterText InlinePattern2 "^.........(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition12=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+10*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+11*#LetterWidth#)))
IfTrueAction12=[!SetOption MeterText InlinePattern2 "^..........(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition13=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+11*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+12*#LetterWidth#)))
IfTrueAction13=[!SetOption MeterText InlinePattern2 "^...........(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition14=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+12*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+13*#LetterWidth#)))
IfTrueAction14=[!SetOption MeterText InlinePattern2 "^............(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition15=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+13*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+14*#LetterWidth#)))
IfTrueAction15=[!SetOption MeterText InlinePattern2 "^.............(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition16=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+14*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+15*#LetterWidth#)))
IfTrueAction16=[!SetOption MeterText InlinePattern2 "^..............(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition17=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+15*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+16*#LetterWidth#)))
IfTrueAction17=[!SetOption MeterText InlinePattern2 "^...............(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition18=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+16*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+17*#LetterWidth#)))
IfTrueAction18=[!SetOption MeterText InlinePattern2 "^................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition19=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+17*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+18*#LetterWidth#)))
IfTrueAction19=[!SetOption MeterText InlinePattern2 "^.................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition20=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+18*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+19*#LetterWidth#)))
IfTrueAction20=[!SetOption MeterText InlinePattern2 "^..................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition20=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+19*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+20*#LetterWidth#)))
IfTrueAction20=[!SetOption MeterText InlinePattern2 "^...................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition21=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+20*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+21*#LetterWidth#)))
IfTrueAction21=[!SetOption MeterText InlinePattern2 "^....................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition22=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+21*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+22*#LetterWidth#)))
IfTrueAction22=[!SetOption MeterText InlinePattern2 "^.....................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition23=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+22*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+23*#LetterWidth#)))
IfTrueAction23=[!SetOption MeterText InlinePattern2 "^......................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition24=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+23*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+24*#LetterWidth#)))
IfTrueAction24=[!SetOption MeterText InlinePattern2 "^.......................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition25=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+24*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+25*#LetterWidth#)))
IfTrueAction25=[!SetOption MeterText InlinePattern2 "^........................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition26=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+25*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+26*#LetterWidth#)))
IfTrueAction26=[!SetOption MeterText InlinePattern2 "^.........................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition27=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+26*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+27*#LetterWidth#)))
IfTrueAction27=[!SetOption MeterText InlinePattern2 "^..........................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition28=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+27*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+28*#LetterWidth#)))
IfTrueAction28=[!SetOption MeterText InlinePattern2 "^...........................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition29=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+28*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+29*#LetterWidth#)))
IfTrueAction29=[!SetOption MeterText InlinePattern2 "^............................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition30=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+29*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+30*#LetterWidth#)))
IfTrueAction30=[!SetOption MeterText InlinePattern2 "^.............................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition31=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+30*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+31*#LetterWidth#)))
IfTrueAction31=[!SetOption MeterText InlinePattern2 "^..............................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition32=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+31*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+32*#LetterWidth#)))
IfTrueAction32=[!SetOption MeterText InlinePattern2 "^...............................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition33=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+32*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+33*#LetterWidth#)))
IfTrueAction33=[!SetOption MeterText InlinePattern2 "^................................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition34=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+33*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+34*#LetterWidth#)))
IfTrueAction34=[!SetOption MeterText InlinePattern2 "^.................................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition35=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+34*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+35*#LetterWidth#)))
IfTrueAction35=[!SetOption MeterText InlinePattern2 "^..................................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition36=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+35*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+36*#LetterWidth#)))
IfTrueAction36=[!SetOption MeterText InlinePattern2 "^...................................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition37=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+36*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+37*#LetterWidth#)))
IfTrueAction37=[!SetOption MeterText InlinePattern2 "^....................................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition38=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+37*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+38*#LetterWidth#)))
IfTrueAction38=[!SetOption MeterText InlinePattern2 "^.....................................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition39=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+38*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+39*#LetterWidth#)))
IfTrueAction39=[!SetOption MeterText InlinePattern2 "^......................................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition40=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+39*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+40*#LetterWidth#)))
IfTrueAction40=[!SetOption MeterText InlinePattern2 "^.......................................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
DynamicVariables=1

[MeterText]
Meter=String
MeasureName=MeasureName
X=(#SkinWidth#-[MeasureX])
Y=20
FontColor=255,255,255
;,(Clamp((([MeasureX:]-110)*6),0,255))
FontSize=12
FontFace=Arial
StringStyle=BOLD
StringAlign=LEFT
InlineSetting=Shadow | 2 | 2 | 3.5 | 150,150,150,200
InlineSetting2=Color | 255,255,255,0
;StringEffect=SHADOW
AntiAlias=1
DynamicVariables=1

[MeterLine]
Meter=Image
SolidColor=255,255,255,150
X=200
Y=17
W=1
H=65

[bg]
Meter=Image
ImageName=bg.png
X=0
Y=0
Note the followings:
  • The letter which at a given moment shouldn't have to be visible are set transparent by the InlinePattern2 / InlineSetting2 options of the [MeterText] string meter.
  • The InlinePattern is set dynamically by the !SetOption bangs if the IfTrueAction options of the [MeasureX] measure.
  • I renounced to the transparency component of the FontColor option ((Clamp((([MeasureX:]-110)*6),0,255))) of the [MeterText] meter (added by eclectic-tech in his last post).
  • I also had to renounce to the Shadow string effect on the [MeterText] meter, because at least as far as I know, the color of the shadow can't be controlled through the InlineOptions. But if the effect is kept, the shadow of the hidden letters appears.
  • The newly added LetterWidth variable ([Variables] section) is the width of a letter. The problem is that at most font types, a such width differs from letter to letter. No good solution for this...
  • The above code works if the shown string has up to 40 letters. If there will be more letters, further IfCondition / IfTrueAction options can be added to the [MeasureX] measure.
User avatar
xenium
Posts: 866
Joined: January 4th, 2018, 9:52 pm

Re: How to create crawling text?

Post by xenium »

balala wrote:I'd modify the code in a way to make the string to be shown up letter by letter. Although this isn't exactly what would be needed, I think a such approach can somehow simulate what you want:

Code: Select all

[Rainmeter]
Update=100
MouseActionCursor=1
SkinWidth=#SkinWidth#

[Variables]
Speed=3
SkinWidth=300
LetterWidth=8
UpdateRateSeconds=6000
URL=https://www.foreca.com/Canada/Newfoundland_and_Labrador/Happy_Valley-Goose_Bay?tenday
;URL=https://www.foreca.com/France/Paris?tenday

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

[MeasureName]
Measure=WebParser
Url=#URL#
RegExp=(?siU)<h1>(.*)</h1>
UpdateRate=#UpdateRateSeconds#
StringIndex=1

[MeasureX]
Measure=Calc
Formula=( #Speed# * COUNTER % ( #SkinWidth# + [MeterText:W] ))
IfCondition=(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]))
IfTrueAction=[!SetOption MeterText InlinePattern2 "^(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition2=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+#LetterWidth#)))
IfTrueAction2=[!SetOption MeterText InlinePattern2 "^.(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition3=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+2*#LetterWidth#)))
IfTrueAction3=[!SetOption MeterText InlinePattern2 "^..(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition4=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+2*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+3*#LetterWidth#)))
IfTrueAction4=[!SetOption MeterText InlinePattern2 "^...(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition5=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+3*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+4*#LetterWidth#)))
IfTrueAction5=[!SetOption MeterText InlinePattern2 "^....(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition6=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+4*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+5*#LetterWidth#)))
IfTrueAction6=[!SetOption MeterText InlinePattern2 "^.....(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition7=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+5*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+6*#LetterWidth#)))
IfTrueAction7=[!SetOption MeterText InlinePattern2 "^......(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition8=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+6*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+7*#LetterWidth#)))
IfTrueAction8=[!SetOption MeterText InlinePattern2 "^.......(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition9=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+7*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+8*#LetterWidth#)))
IfTrueAction9=[!SetOption MeterText InlinePattern2 "^........(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition10=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+8*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+9*#LetterWidth#)))
IfTrueAction10=[!SetOption MeterText InlinePattern2 "^........(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition11=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+9*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+10*#LetterWidth#)))
IfTrueAction11=[!SetOption MeterText InlinePattern2 "^.........(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition12=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+10*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+11*#LetterWidth#)))
IfTrueAction12=[!SetOption MeterText InlinePattern2 "^..........(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition13=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+11*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+12*#LetterWidth#)))
IfTrueAction13=[!SetOption MeterText InlinePattern2 "^...........(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition14=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+12*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+13*#LetterWidth#)))
IfTrueAction14=[!SetOption MeterText InlinePattern2 "^............(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition15=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+13*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+14*#LetterWidth#)))
IfTrueAction15=[!SetOption MeterText InlinePattern2 "^.............(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition16=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+14*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+15*#LetterWidth#)))
IfTrueAction16=[!SetOption MeterText InlinePattern2 "^..............(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition17=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+15*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+16*#LetterWidth#)))
IfTrueAction17=[!SetOption MeterText InlinePattern2 "^...............(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition18=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+16*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+17*#LetterWidth#)))
IfTrueAction18=[!SetOption MeterText InlinePattern2 "^................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition19=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+17*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+18*#LetterWidth#)))
IfTrueAction19=[!SetOption MeterText InlinePattern2 "^.................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition20=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+18*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+19*#LetterWidth#)))
IfTrueAction20=[!SetOption MeterText InlinePattern2 "^..................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition20=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+19*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+20*#LetterWidth#)))
IfTrueAction20=[!SetOption MeterText InlinePattern2 "^...................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition21=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+20*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+21*#LetterWidth#)))
IfTrueAction21=[!SetOption MeterText InlinePattern2 "^....................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition22=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+21*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+22*#LetterWidth#)))
IfTrueAction22=[!SetOption MeterText InlinePattern2 "^.....................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition23=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+22*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+23*#LetterWidth#)))
IfTrueAction23=[!SetOption MeterText InlinePattern2 "^......................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition24=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+23*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+24*#LetterWidth#)))
IfTrueAction24=[!SetOption MeterText InlinePattern2 "^.......................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition25=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+24*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+25*#LetterWidth#)))
IfTrueAction25=[!SetOption MeterText InlinePattern2 "^........................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition26=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+25*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+26*#LetterWidth#)))
IfTrueAction26=[!SetOption MeterText InlinePattern2 "^.........................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition27=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+26*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+27*#LetterWidth#)))
IfTrueAction27=[!SetOption MeterText InlinePattern2 "^..........................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition28=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+27*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+28*#LetterWidth#)))
IfTrueAction28=[!SetOption MeterText InlinePattern2 "^...........................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition29=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+28*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+29*#LetterWidth#)))
IfTrueAction29=[!SetOption MeterText InlinePattern2 "^............................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition30=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+29*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+30*#LetterWidth#)))
IfTrueAction30=[!SetOption MeterText InlinePattern2 "^.............................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition31=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+30*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+31*#LetterWidth#)))
IfTrueAction31=[!SetOption MeterText InlinePattern2 "^..............................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition32=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+31*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+32*#LetterWidth#)))
IfTrueAction32=[!SetOption MeterText InlinePattern2 "^...............................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition33=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+32*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+33*#LetterWidth#)))
IfTrueAction33=[!SetOption MeterText InlinePattern2 "^................................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition34=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+33*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+34*#LetterWidth#)))
IfTrueAction34=[!SetOption MeterText InlinePattern2 "^.................................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition35=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+34*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+35*#LetterWidth#)))
IfTrueAction35=[!SetOption MeterText InlinePattern2 "^..................................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition36=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+35*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+36*#LetterWidth#)))
IfTrueAction36=[!SetOption MeterText InlinePattern2 "^...................................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition37=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+36*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+37*#LetterWidth#)))
IfTrueAction37=[!SetOption MeterText InlinePattern2 "^....................................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition38=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+37*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+38*#LetterWidth#)))
IfTrueAction38=[!SetOption MeterText InlinePattern2 "^.....................................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition39=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+38*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+39*#LetterWidth#)))
IfTrueAction39=[!SetOption MeterText InlinePattern2 "^......................................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
IfCondition40=((#CURRENTSECTION#>(#SkinWidth#-[MeterLine:X]+39*#LetterWidth#))&&(#CURRENTSECTION#<=(#SkinWidth#-[MeterLine:X]+40*#LetterWidth#)))
IfTrueAction40=[!SetOption MeterText InlinePattern2 "^.......................................(.*)$"][!UpdateMeter "MeterText"][!Redraw]
DynamicVariables=1

[MeterText]
Meter=String
MeasureName=MeasureName
X=(#SkinWidth#-[MeasureX])
Y=20
FontColor=255,255,255
;,(Clamp((([MeasureX:]-110)*6),0,255))
FontSize=12
FontFace=Arial
StringStyle=BOLD
StringAlign=LEFT
InlineSetting=Shadow | 2 | 2 | 3.5 | 150,150,150,200
InlineSetting2=Color | 255,255,255,0
;StringEffect=SHADOW
AntiAlias=1
DynamicVariables=1

[MeterLine]
Meter=Image
SolidColor=255,255,255,150
X=200
Y=17
W=1
H=65

[bg]
Meter=Image
ImageName=bg.png
X=0
Y=0
Note the followings:
  • The letter which at a given moment shouldn't have to be visible are set transparent by the InlinePattern2 / InlineSetting2 options of the [MeterText] string meter.
  • The InlinePattern is set dynamically by the !SetOption bangs if the IfTrueAction options of the [MeasureX] measure.
  • I renounced to the transparency component of the FontColor option ((Clamp((([MeasureX:]-110)*6),0,255))) of the [MeterText] meter (added by eclectic-tech in his last post).
  • I also had to renounce to the Shadow string effect on the [MeterText] meter, because at least as far as I know, the color of the shadow can't be controlled through the InlineOptions. But if the effect is kept, the shadow of the hidden letters appears.
  • The newly added LetterWidth variable ([Variables] section) is the width of a letter. The problem is that at most font types, a such width differs from letter to letter. No good solution for this...
  • The above code works if the shown string has up to 40 letters. If there will be more letters, further IfCondition / IfTrueAction options can be added to the [MeasureX] measure.
Wow! :17what
Congratulations! :17good
I think this is the best solution.
I just made a little change, suggested by you above.
balala wrote:Probably you should have to use another value for the SkinWidth variable ([Variables] section). SkinWidth=200 seems a proper value, but you have to decide.
Anyway, modifying this variable will require to set explicitly the width of the skin, into the [Rainmeter] section: SkinWidth=300 (instead of SkinWidth=#SkinWidth#).
So the text appears as soon as the last letter disappears into the left margin
Thank you very much ! :bow:
User avatar
balala
Rainmeter Sage
Posts: 16166
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to create crawling text?

Post by balala »

You're welcome.