we defined the variable, UpdateRateSeconds = 6000balala wrote:Which one solution did you choose? You removed that option or defined the variable?
It is currently March 29th, 2024, 4:02 pm
How to create crawling text?
-
- Posts: 841
- Joined: January 4th, 2018, 9:52 pm
Re: How to create crawling text?
-
- Posts: 841
- Joined: January 4th, 2018, 9:52 pm
Re: How to create crawling text?
Hi ,
I come back with a question:
can the code change, so the text runs a little more inside the skin, now it runs from the edge to the edge?
Thanks
I come back with a question:
can the code change, so the text runs a little more inside the skin, now it runs from the edge to the edge?
Thanks
Code: Select all
[Rainmeter]
Author=xenium
Update=100
MouseActionCursor=1
SkinWidth=#SkinWidth#
[Variables]
Speed=3
SkinWidth=160
UpdateRateSeconds=6000
URL=https://www.foreca.com/Japan/Tokyo?tenday
URL1=https://www.foreca.com/Japan/Tokyo
;----------------------------------------
[MeasureName]
Measure=Plugin
Plugin=Plugins/WebParser.dll
Url=#URL#
RegExp="(?siU)<h1>(.*)</h1>.*"
UpdateRate=#UpdateRateSeconds#
Substitute="°":""
StringIndex=1
[image]
meter=image
imagename=Bg.png
x=0
y=0
w=160
[MeterText]
Meter=String
MeasureName=MeasureName
X=(#SkinWidth#-[MeasureX])
Y=5
FontColor=0,0,0
FontSize=16
FontFace=Stagnation BRK
FontEffectColor=255,255,255
StringStyle=BOLD
StringAlign=LEFT
StringEffect=SHADOW
AntiAlias=1
DynamicVariables=1
[MeasureX]
Measure=Calc
Formula=( #Speed# * COUNTER % ( #SkinWidth# + [MeterText:W] ))
DynamicVariables=1
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: How to create crawling text?
Not sure I understand what you mean by "a little more inside the skin". What should have to be the most left and most right position of the string?xenium wrote:can the code change, so the text runs a little more inside the skin, now it runs from the edge to the edge?
-
- Posts: 841
- Joined: January 4th, 2018, 9:52 pm
Re: How to create crawling text?
for example if the skin width = 160, the text runs between 140 and 20. Now it runs between 160 and 0balala wrote:Not sure I understand what you mean by "a little more inside the skin". What should have to be the most left and most right position of the string?
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: How to create crawling text?
No actually it runs between 160 and -TextWidth (where obviously TextWidth is the width of the shown string). That's why it goes outside of the skin to left. If we let it to run between 140 and 20 the string will partially goes outside of the skin, to right, but doesn't to left. Your idea would be good only if the width of the skin would be (much) greater then the width of the string.xenium wrote:for example if the skin width = 160, the text runs between 140 and 20. Now it runs between 160 and 0
-
- Posts: 841
- Joined: January 4th, 2018, 9:52 pm
Re: How to create crawling text?
ok, thanks for your replybalala wrote:No actually it runs between 160 and -TextWidth (where obviously TextWidth is the width of the shown string). That's why it goes outside of the skin to left. If we let it to run between 140 and 20 the string will partially goes outside of the skin, to right, but doesn't to left. Your idea would be good only if the width of the skin would be (much) greater then the width of the string.
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: How to create crawling text?
No, no, I didn't say it's impossible. It's not at all (in the meantime I also clarified a few things for myself). And I will do it, but not today, because here is almost midnight and soon I'll go to sleep. But if you can wait, I promise tomorrow a solution.xenium wrote:ok, thanks for your reply
-
- Posts: 841
- Joined: January 4th, 2018, 9:52 pm
Re: How to create crawling text?
ok thank you, there is no rushbalala wrote:No, no, I didn't say it's impossible. It's not at all (in the meantime I also clarified a few things for myself). And I will do it, but not today, because here is almost midnight and soon I'll go to sleep. But if you can wait, I promise tomorrow a solution.
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: How to create crawling text?
Ok, here is a quick solution, which maybe will have to be polished a bit, but at first test it seem to be working.
Define first the Limit variable, in the [Variables] section. This will be the limit of the distance between the string and the edge of the skin:
Now replace the old X option of the [MeterText] meter (X=(#SkinWidth#-[MeasureX])) with the following one: X=[MeasureX].
And finally replace the [MeasureX] measure with this:
The difference is that this time the string moves in two directions: first to right, then when it reaches its most right position, it turns back and moves to left. Then the process is repeated after the string reaches its most left position.
Please let me know if it is ok or you would like to modify anything.
Define first the Limit variable, in the [Variables] section. This will be the limit of the distance between the string and the edge of the skin:
Code: Select all
[Variables]
...
Limit=20
And finally replace the [MeasureX] measure with this:
Code: Select all
[MeasureX]
Measure=Calc
Formula=( MeasureX + #Speed# )
IfCondition=((#CURRENTSECTION#>=#SkinWidth#-[MeterText:W]-#Limit#)&&(#Speed#>0))
IfTrueAction=[!SetVariable Speed "(-1*#Speed#)"][!UpdateMeasure "#CURRENTSECTION#"]
IfCondition2=((#CURRENTSECTION#<=#Limit#)&&(#Speed#<0))
IfTrueAction2=[!SetVariable Speed "(-1*#Speed#)"][!UpdateMeasure "#CURRENTSECTION#"]
DynamicVariables=1
Please let me know if it is ok or you would like to modify anything.
-
- Posts: 841
- Joined: January 4th, 2018, 9:52 pm
Re: How to create crawling text?
this solution is good when the width of the text is small but when the width of the text is larger and does not fit in the width of the skin, it does not workbalala wrote:Ok, here is a quick solution, which maybe will have to be polished a bit, but at first test it seem to be working.
Define first the Limit variable, in the [Variables] section. This will be the limit of the distance between the string and the edge of the skin:Now replace the old X option of the [MeterText] meter (X=(#SkinWidth#-[MeasureX])) with the following one: X=[MeasureX].Code: Select all
[Variables] ... Limit=20
And finally replace the [MeasureX] measure with this:The difference is that this time the string moves in two directions: first to right, then when it reaches its most right position, it turns back and moves to left. Then the process is repeated after the string reaches its most left position.Code: Select all
[MeasureX] Measure=Calc Formula=( MeasureX + #Speed# ) IfCondition=((#CURRENTSECTION#>=#SkinWidth#-[MeterText:W]-#Limit#)&&(#Speed#>0)) IfTrueAction=[!SetVariable Speed "(-1*#Speed#)"][!UpdateMeasure "#CURRENTSECTION#"] IfCondition2=((#CURRENTSECTION#<=#Limit#)&&(#Speed#<0)) IfTrueAction2=[!SetVariable Speed "(-1*#Speed#)"][!UpdateMeasure "#CURRENTSECTION#"] DynamicVariables=1
Please let me know if it is ok or you would like to modify anything.