Created
April 7, 2023 19:30
-
-
Save reisir/e3e8e067812aeb890e75f900fbbbca76 to your computer and use it in GitHub Desktop.
horizontally scrolling text rainmeter example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Rainmeter] | |
DefaultUpdateDivider=-1 | |
Update=16 | |
[Variables] | |
; User settings | |
Spacing=20 | |
MaxWidth=500 | |
ScrollStepSize=1 | |
ScrollStartDelay=1000 | |
; Internal | |
InitialPosition=#Spacing# | |
ScrollX=#InitialPosition# | |
ActionTimerDelay=10 | |
; Bangs | |
UR=[!UpdateMeterGroup Scroll][!Redraw] | |
Reset=[!SetVariable ScrollX [#InitialPosition]] | |
; ANIMATION MEASURES | |
; order matters, SrollSteps needs to update before MeasureActionTimer | |
[ScrollSteps] | |
Measure=Calc | |
Formula=Floor(([Text:W] + #Spacing#) / #ScrollStepSize#) | |
DynamicVariables=1 | |
Group=Scroll | |
[MeasureActionTimer] | |
Measure=Plugin | |
Plugin=ActionTimer | |
Group=Scroll | |
ActionList1=Repeat Move, [#ActionTimerDelay], [ScrollSteps:] | Restart | |
Restart=#Reset# #UR# [!CommandMeasure MeasureActionTimer "Execute 1"] [!Log "restart scroll cycle"] | |
Move=[!SetVariable ScrollX "([#ScrollX] - [#ScrollStepSize])"] #UR# | |
DynamicVariables=1 | |
[CheckScroll] | |
Measure=Calc | |
IfConditionMode=1 | |
IfCondition=(([Text:W] + #InitialPosition#) > #MaxWidth#) | |
IfTrueAction=[!Log "text doesn't fit"][!CommandMeasure MeasureActionTimer "Stop 1"][!ShowMeter TextCopy] #Reset# #UR# [!Delay [#ScrollStartDelay]] [!Log "start scroll"][!CommandMeasure MeasureActionTimer "Execute 1"] | |
IfFalseAction=[!Log "text fits, no scroll"][!CommandMeasure MeasureActionTimer "Stop 1"][!HideMeter TextCopy] #Reset# #UR# | |
Group=Scroll | |
DynamicVariables=1 | |
; TEXT SOURCE | |
; Can be any measure, WebNowPlaying used as an example | |
[TextSource] | |
Measure=Plugin | |
Plugin=WebNowPlaying | |
PlayerType=Title | |
OnChangeAction=[!Log "text source changed"][!CommandMeasure MeasureActionTimer "Stop 1"] #Reset# #UR# [!UpdateMeasureGroup Scroll] | |
UpdateDivider=1 | |
; SCROLL | |
[ScrollStyle] | |
MeasureName=TextSource | |
Container=ScrollContainer | |
Group=Scroll | |
X=#ScrollX# | |
DynamicVariables=1 | |
; OPTIONAL STYLE | |
[StringStyle] | |
FontFace=Segoe UI | |
FontSize=24 | |
FontColor=FFFFFF | |
AntiAlias=1 | |
SolidColor=00000001 | |
; METERS | |
[ScrollContainer] | |
Meter=Shape | |
Shape=Rectangle 0, 0, #MaxWidth#, [Text:H] | StrokeWidth 0 | |
DynamicVariables=1 | |
[Text] | |
Meter=String | |
MeterStyle=ScrollStyle | StringStyle | |
[TextCopy] | |
Meter=String | |
MeterStyle=ScrollStyle | StringStyle | |
X=#Spacing#R |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment