creativegamer_03 wrote: ↑November 15th, 2021, 11:55 pm
Actually, if you do have a better way to do it, please do post it. I'm welcome for better code.
In meantime while we're waiting for death.crafter's code, here is mine. Please check it. For now I worked only with the title, didn't so far with the artist. If you find the solution good enough, a similar technique can be used for the artist as well, to get it scrolling as well (can help with this as well).
Code: Select all
[Rainmeter]
Update=1000
AccurateText=1
BackgroundMode=2
SolidColor=0,0,0,1
;OnRefreshAction=[!SetVariable Marquee1 0][!SetVariable Marquee2 0][!SetVariable Marquee3 0][!SetVariable Marquee4 0][!CommandMeasure MeasureActionTimer "Stop 1"][!CommandMeasure MeasureActionTimer "Stop 2"][!CommandMeasure MeasureActionTimer "Stop 3"][!CommandMeasure MeasureActionTimer "Stop 4"][!CommandMeasure MeasureActionTimer "Execute 1"][!CommandMeasure MeasureActionTimer "Execute 2"][!CommandMeasure MeasureActionTimer "Execute 3"][!CommandMeasure MeasureActionTimer "Execute 4"][!KeepOnScreen #KeepOnScreen#]
[Metadata]
Name=CoveR Left
Author=NikolaRabra (rabra.deviantart.com)
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Version=1 (20140909)
[Variables]
@includeVars=#@#Variables.inc
marquee1=0
marquee2=0
marquee3=0
marquee4=0
ProgressAlpha=1
Step=-1
NoTitleNameText=N/A
NoArtistNameText=N/A
NoAlbumNameText=N/A
; Added to test (Should be in your included variables.inc file)
TextWidth=300
Color=255,255,255,155
Alpha=300
HideInfo=0
KeepOnScreen=0
; Marquee settings
animationSpeed=1
marqueeBeginWait=3000
marqueeEndWait=3000
; Dynamic variables - do not change
StayVis=50
TitleStayVis=#StayVis#
EnTitle=0
; Styles ------------------------------------------------------------------------------------------
[StringStyleLarge]
FontFace=Segoe UI Light
FontColor=#Color#,(255*(#Alpha#))
;FontSize=19
FontSize=19
StringStyle=Normal
StringEffect=None
FontEffectColor=0,0,0,(255*(#Alpha#))
AntiAlias=1
Container=MeterTextContainer
DynamicVariables=1
; Measures ----------------------------------------------------------------------------------------
[MeasureArtist]
Measure=Plugin
Plugin=NowPlaying
PlayerName=WMP
PlayerType=ARTIST
Substitute="":"#NoArtistNameText#"
OnChangeAction=[!SetVariable TitleStayVis "#StayVis#"][!UpdateMeasure "MeasureMarquee1Offset"]
;UpdateDivider=100
;OnChangeAction=[!Refresh "#CurrentConfig#"]
[MeasureAlbum]
Measure=NowPlaying
PlayerName=[MeasureArtist]
PlayerType=ALBUM
Substitute="":"#NoAlbumNameText#"
;UpdateDivider=100
[MeasureTitle]
Measure=NowPlaying
PlayerName=[MeasureArtist]
PlayerType=TITLE
Substitute="":"#NoTitleNameText#"
;UpdateDivider=100
[MeasureYear]
Measure=NowPlaying
PlayerName=[MeasureArtist]
PlayerType=YEAR
; Marquee Measures
[MeasureMarquee1Offset]
Measure=Calc
Formula=( max ( 0, [Title:W] ))
;Formula=( 2 * max ( 0, ( [Title:W] - [MeterTextContainer:W] )))
DynamicVariables=1
[MeasureMarquee1_Offset]
Measure=Calc
Formula=( max( 0, ( [MeterTextContainer:W] - [Title:X] )))
DynamicVariables=1
[MeasureMarquee2Offset]
Measure=Calc
Formula=( 5 * max ( 0, ( [Artist:W] - [MeterTextContainer:W] )))
DynamicVariables=1
[MeasureMarquee3Offset]
Measure=Calc
Formula=( 14 * max ( 0, ( [Album:W] - [MeterTextContainer:W] )))
DynamicVariables=1
[MeasureMarquee4Offset]
Measure=Calc
Formula=( 14 * max ( 0, ( [Year:W] - [MeterTextContainer:W] )))
DynamicVariables=1
[MeasureTitleLength]
Measure=Calc
Formula=( [Title:W] > #CURRENTCONFIGWIDTH# )
IfCondition=(MeasureTitleLength>=1)
IfTrueAction=[!SetVariable EnTitle "1"][!UpdateMeasure "MeasureActionTimer"][!CommandMeasure "MeasureActionTimer" "Execute 1"]
IfFalseAction=[!SetVariable EnTitle "0"][!SetVariable marquee1 "0"][!UpdateMeasure "MeasureActionTimer"][!CommandMeasure "MeasureActionTimer" "Stop 1"]
DynamicVariables=1
[MeasureActionTimer]
Measure=Plugin
Plugin=ActionTimer
; Marquee 1
ActionList1=Repeat Move1,#animationSpeed#,[MeasureMarquee1Offset:]
; | Repeat HMove1,1,1 | Repeat Move1,#animationSpeed#,[MeasureMarquee1_Offset:] | Reset1 | Wait #marqueeBeginWait# | DoOver1
Reset1=[!SetVariable marquee1 0][!UpdateMeasure MeasureActionTimer][!UpdateMeter "Title"][!Redraw]
Move1=[!SetVariable marquee1 "(#marquee1# - 1)"][!UpdateMeasure MeasureActionTimer][!UpdateMeter "Title"][!Redraw]
HMove1=[!SetVariable marquee1 "[MeterTextContainer:W]"][!UpdateMeasure MeasureActionTimer][!UpdateMeter "Title"][!Redraw]
DoOver1=[!CommandMeasure MeasureActionTimer "Execute 1"]
; Marquee 2
ActionList2=Repeat Move2,#animationSpeed#,[MeasureMarquee2Offset:] | Wait #marqueeEndWait# | Reset2 | Wait #marqueeBeginWait# | DoOver2
Reset2=[!SetVariable marquee2 0][!UpdateMeasure MeasureActionTimer][!UpdateMeter Artist][!Redraw]
Move2=[!SetVariable marquee2 "(#marquee2# - 1)"][!UpdateMeasure MeasureActionTimer][!UpdateMeter Artist][!Redraw]
DoOver2=[!CommandMeasure MeasureActionTimer "Execute 2"]
; Marquee 3
ActionList3=Repeat Move3,#animationSpeed#,[MeasureMarquee3Offset:] | Wait #marqueeEndWait# | Reset3 | Wait #marqueeBeginWait# | DoOver3
Reset3=[!SetVariable marquee3 0][!UpdateMeasure MeasureActionTimer][!UpdateMeter Album][!Redraw]
Move3=[!SetVariable marquee3 "(#marquee3# - 1)"][!UpdateMeasure MeasureActionTimer][!UpdateMeter Album][!Redraw]
DoOver3=[!CommandMeasure MeasureActionTimer "Execute 3"]
; Marquee 4
ActionList4=Repeat Move4,#animationSpeed#,[MeasureMarquee4Offset:] | Wait #marqueeEndWait# | Reset4 | Wait #marqueeBeginWait# | DoOver4
Reset4=[!SetVariable marquee4 0][!UpdateMeasure MeasureActionTimer][!UpdateMeter Year][!Redraw]
Move3=[!SetVariable marquee3 "(#marquee3# - 1)"][!UpdateMeasure MeasureActionTimer][!UpdateMeter Year][!Redraw]
DoOver4=[!CommandMeasure MeasureActionTimer "Execute 4"]
IfCondition=((Abs(#marquee1#)>=[MeasureMarquee1Offset:]-#TitleStayVis#)&&(#EnTitle#>=1))
IfTrueAction=[!CommandMeasure "MeasureActionTimer" "Stop 1"][!SetVariable marquee1 "0"][!UpdateMeasure "MeasureActionTimer"][!Redraw][!Delay "1000"][!CommandMeasure "MeasureActionTimer" "Execute 1"]
DynamicVariables=1
; Container to control scrolling based on TextWidth
[MeterTextContainer]
Meter=Image
SolidColor=255,255,255,155
X=1
Y=1
W=#TextWidth#
H=155
; Info Text ---------------------------------------------------------------------------------------
[Title]
Meter=STRING
MeasureName=MeasureTitle
MeterStyle=StringStyleLarge
StringAlign=LeftBottom
X=#marquee1#
Y=38
Text=%1
Group=Info
Hidden=#HideInfo#
StringStyle=bold
[Artist]
Meter=STRING
MeasureName=MeasureArtist
MeterStyle=StringStyleLarge
StringAlign=LeftTop
Text=%1
X=#marquee2#
Y=36
Group=Info
Hidden=#HideInfo#
StringStyle=bold
[Album]
Meter=STRING
MeasureName=MeasureAlbum
MeterStyle=StringStyleLarge
StringAlign=LeftTop
Text=%1
X=#marquee3#
Y=72
Group=Info
Hidden=#HideInfo#
StringStyle=bold
[Year]
Meter=STRING
MeasureName=MeasureYear
MeterStyle=StringStyleLarge
StringAlign=LeftTop
Text=%1
X=#marquee4#
Y=106
Group=Info
Hidden=#HideInfo#
StringStyle=bold
I added new variables (StayVis, TitleStayVis and EnTitle) and a new measure ([MeasureTitleLength]). The StayVis variable represents the length (in pixels) of the string which remains visible when the scrolling of title ends. You can set for this the value you want. The TitleStayVis and EnTitle variables are needed in the code, you shouldn't change / alter them.
Note that I rewrote the [MeasureArtist], [MeasureAlbum], [MeasureTitle] and [MeasureYear] measures to be NowPlaying measures, because even if a while ago NowPlaying was a plugin, in meantime it became an internal measure and should be used so. I also modified the Update value of the code (into the [Rainmeter] section) to the default
Update=1000, because since the scrolling is controlled by an ActionTimer plugin measure, there is not needed to have such a low update value.
Please let me know if the skin works as expected, or if there is any trouble with it, a description of what isn't going on well.