It is currently May 25th, 2024, 9:24 pm

Scrolling text

Get help with creating, editing & fixing problems with skins
User avatar
Yincognito
Rainmeter Sage
Posts: 7330
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Scrolling text

Post by Yincognito »

balala wrote: April 6th, 2020, 5:31 pmOk, will take a look...
Thanks. Of course, I could make this work very easily, by putting the Title in [TopText] as well, like this:

Code: Select all

[TopText]
MeasureName=#topText##MusicSwitch#
MeasureName2=#bottomText##MusicSwitch#
...
Text="%1#CRLF#%2"
and then just let your code apply the scrolling to [TopText] as a whole, but that might slightly reduce the vertical distance between the Artist and Title rows (since a #CRLF# adds sligthly less height between lines than a different meter's Y=0R)...
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Crash
Posts: 47
Joined: February 12th, 2020, 1:53 am

Re: Scrolling text

Post by Crash »

Yincognito wrote: April 6th, 2020, 5:18 pm Just realizing this: do you actually want that the music with longer names (that can still fit the container and be entirely visible) still implements a way of "scrolling" by eating out their first chars? I'm trying to see if it's the "scroll" (in all circumstances, irrespective of string lengths) that you actually want, or it's the "effect" of eating out the first chars? Because if it's the former, then this could be done much easier, by endlessly scrolling artist and title no matter their length. If it's the latter, then the "eat out" effect is required.

So, which one is it? Just trying to get your view on this beforehand, so that the final result won't need any more adjustments and be exactly what you envision.
Either works really, whatever is easiest my sorta vision atm is(Using my earlier example) Burn My Dread ~Last Battle~ would most like only show Dread ~Last Battle~ (Or something similar to that), then start eating characters from the front, Slight edit, The entirety would scroll out just by the time it's all scrolled out only the last part would show (everything else just being outside the container untill eaten
User avatar
Yincognito
Rainmeter Sage
Posts: 7330
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Scrolling text

Post by Yincognito »

Crash wrote: April 6th, 2020, 5:48 pm Either works really, whatever is easiest my sorta vision atm is(Using my earlier example) Burn My Dread ~Last Battle~ would most like only show Dread ~Last Battle~ (Or something similar to that), then start eating characters from the front, Slight edit, The entirety would scroll out just by the time it's all scrolled out only the last part would show (everything else just being outside the container untill eaten
Ok, I now understand. So you basically want exactly what you posted in the first video and what I replicated in my code, just applied to this skin.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Crash
Posts: 47
Joined: February 12th, 2020, 1:53 am

Re: Scrolling text

Post by Crash »

Yincognito wrote: April 6th, 2020, 5:54 pm Ok, I now understand. So you basically want exactly what you posted in the first video and what I replicated in my code, just applied to this skin.
Yep, https://youtu.be/rb_ExzxfcXU is the full video incase it's needed, although it only shows what I had put in the gif heh
User avatar
Yincognito
Rainmeter Sage
Posts: 7330
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Scrolling text

Post by Yincognito »

Crash wrote: April 6th, 2020, 6:03 pm Yep, https://youtu.be/rb_ExzxfcXU is the full video incase it's needed, although it only shows what I had put in the gif heh
Yep. In the meantime, I solved the inability to scroll in certain situations. Removing the IfCondition, IfTrueAction and IfFalseAction lines from [mTopTextWidth] and placing this in [mBottomTextWidth] scrolls text if any of the artist or the title is greater than #Width# (300px in balala's code):

Code: Select all

IfCondition=(Max(mTopTextWidth,mBottomTextWidth)<#Width#)
IfTrueAction=[!DisableMeasure "MeasureScroll"]
IfFalseAction=[!EnableMeasure "MeasureScroll"]
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7330
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Scrolling text

Post by Yincognito »

Crash wrote: April 6th, 2020, 6:03 pm Yep, https://youtu.be/rb_ExzxfcXU is the full video incase it's needed, although it only shows what I had put in the gif heh
So that you know, I didn't forget you. I made both the scroll and eating out the chars ever since yesterday, but there are a couple of things that don't work yet. I can post a "prototype" in the meantime, but it won't be that usable, so best is to post the whole thing when it's done the way I want to. So it may take a little longer - depending on how busy I am with other stuff and how quickly I find a way to make what doesn't work now work. One thing I can guarantee, it will work eventually - the things that are not yet alright are more about some particular situations when one thing prevents another one happening correctly, rather than not being able to make the effects work (which is, as I said, already completed since yesterday).
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Crash
Posts: 47
Joined: February 12th, 2020, 1:53 am

Re: Scrolling text

Post by Crash »

Yincognito wrote: April 7th, 2020, 3:23 pm So that you know, I didn't forget you. I made both the scroll and eating out the chars ever since yesterday, but there are a couple of things that don't work yet. I can post a "prototype" in the meantime, but it won't be that usable, so best is to post the whole thing when it's done the way I want to. So it may take a little longer - depending on how busy I am with other stuff and how quickly I find a way to make what doesn't work now work. One thing I can guarantee, it will work eventually - the things that are not yet alright are more about some particular situations when one thing prevents another one happening correctly, rather than not being able to make the effects work (which is, as I said, already completed since yesterday).
Don't stress it! I appreciate all the work you do and I can wait for it to be done to get it! Take your time, I have other things I've been working on in the meantime and I understand you have a life outside of rainmeter stuffs, the fact that you are helping me I'm super gratefull for already, don't stress any dates!
User avatar
balala
Rainmeter Sage
Posts: 16262
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Scrolling text

Post by balala »

Crash wrote: April 5th, 2020, 10:10 pm but sometimes it seems to make a "Jump" rather than hiding or removing each character,
Alright, fixed this as well. It took a while, but finally I hope I did it.
So, first you have to add an OnChangeAction option to the Cleartext\@Resources\base.ini file. Add it to its [mTitle0] measure: OnChangeAction=[!CommandMeasure "MeasureTitleIn" "Execute 1"][!SetVariable Step "0"][!UpdateMeasure "MeasureTitleSc"][!Redraw] (the [MeasureTitleIn] ActionTimer plugin measure and the [MeasureTitleSc] measure will be added immediately, in the code of the skin's main file - Cleartext.ini - see below).
There is only one more thing you have to do: replace the code of the Cleartext\Cleartext.ini skin file with the following one:

Code: Select all

[Rainmeter]
Update=1000
MouseOverAction=[!ShowMeterGroup Hover][!ShowMeterGroup #stowAwayName#][!Redraw]
MouseLeaveAction=[!HideMeterGroup Hover][!HideMeterGroup #stowAwayName#][!Redraw]
AccurateText=1
DynamicWindowSize=1
SkinHeight=(#skinSize#*0.25)
ContextTitle=Open Settings panel
ContextAction=!ActivateConfig "Cleartext\Settings"
ContextTitle2=Use Cleartext Pure
ContextAction2=!ActivateConfig "Cleartext"

[Metadata]
Name=Cleartext
Author=Redsaph
Description=Displays track information from various media players.
Version=5.2
License=Creative Commons BY-NC-SA 3.0

[Variables]
@include=#@#base.ini
currentlySetAlign=right
Width=300
Speed=5
U=[!UpdateMeasure "MeasureTitleIn"][!UpdateMeasure "MeasureTitleSc"][!Redraw]
Step=0

; STYLES ==========================================
[styleTextControls]
FontFace=#controlsFont#
FontSize=(#skinSize#*0.027)
AntiAlias=1
FontColor=#translucent#
StringAlign=#interfaceTextAlignment#
DynamicVariables=1
Hidden=1
Group=Hover | Visible
MouseActionCursor=1

[styleTextMini]
FontFace=#controlsFont#
FontSize=(#skinSize#*0.0175)
AntiAlias=1
FontColor=#opaque#
StringAlign=#interfaceTextAlignment#
DynamicVariables=1
Hidden=1
Group=Hover | Visible

[styleTextMajor]
H=(#skinSize#*0.085)
FontSize=(#skinSize#*0.0625)
FontColor=#opaque#
AntiAlias=1
Group=Visible

; =================================================
; Meters

[LuaSettings]
Measure=Script
ScriptFile=#@#settings.lua

[mTopTextWidth]
Measure=Calc
Formula=[TopText:W]
OnChangeAction=[!WriteKeyValue Variables topTextWidth "[mTopTextWidth]" "#@#variables.inc"]
DynamicVariables=1
Group=AlignmentMeasure

[mBottomTextWidth]
Measure=Calc
Formula=[BottomText:W]
OnChangeAction=[!WriteKeyValue Variables bottomTextWidth "[mBottomTextWidth]" "#@#variables.inc"][!CommandMeasure "LuaAlign" "alignRightOnUpdate()"]
DynamicVariables=1
Group=AlignmentMeasure

[LuaAlign]
Measure=Script
ScriptFile=#@#align.lua
UpdateDivider=8
DynamicVariables=1

[MeasureTitle]
Measure=String
String=[mTitle0]
RegExpSubstitute=1
Substitute="(.)":"0","^(0)":"1"
DynamicVariables=1

[MeasureTitleSc]
Measure=String
String=[mTitle0]
RegExpSubstitute=1
Substitute="^(.{#Step#}).*$":"\1","\\1":""
IfCondition=([BottomText2:W]>=#Width#)
IfTrueAction=[!CommandMeasure "MeasureTitleIn" "Stop 1"][!SetVariable Step "[MeasureTitleLength]"][!EnableMeasure "MeasureScroll"]#U#
DynamicVariables=1

[MeasureTitleLength]
Measure=Calc
Formula=( Log ( 10 * [MeasureTitle] ))
DynamicVariables=1

[MeasureTitleIn]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat TitleIn,200/#Speed#,[MeasureTitleLength]
TitleIn=[!SetVariable Step "(#Step#+1)"]#U#
DynamicVariables=1

[Background]
Meter=Image
X=0
Y=0
W=((#skinSize# > #lastSetWidth#) ? (#skinSize#+(#skinSize#*0.35)) : (#lastSetWidth#+(#skinSize#*0.35)))
H=(#skinSize#*0.25)
SolidColor=0,0,0,1
DynamicVariables=1
Group=Visible

[Now]
Meter=String
Text=Now
StringCase=Upper
StringAlign=#interfaceTextAlignment#
FontSize=(#skinSize#*0.03)
FontColor=#opaque#
X=#nowTextPositionHor#
Y=(#skinSize#*0.09)
AntiAlias=1
FontFace=#controlsFont#
UpdateDivider=-1
Hidden=#stowAway#
Group=Stow | Visible

[Playing]
Meter=String
Text=Playing
StringCase=Upper
StringAlign=#interfaceTextAlignment#
FontSize=(#skinSize#*0.03)
FontColor=#opaque#
X=r
Y=(#skinSize#*0.125)
AntiAlias=1
FontFace=#controlsFont#
UpdateDivider=-1
Hidden=#stowAway#
Group=Stow | Visible

[Hairline]
Meter=Bar
MeasureName=mProgress#MusicSwitch#P
X=#hairlinePositionHor#
W=(#skinSize#*0.005)
H=(#skinSize#*0.25)
BarColor=#over#
SolidColor=#opaque#
BarOrientation=Vertical
ToolTipText="Progress Bar"
UpdateDivider=4
Hidden=#stowAway#
Group=Stow | Visible

[MeterContainer]
Meter=Image
SolidColor=0,0,0,255
X=#topTextPositionHor#
Y=(#skinSize#*0.14-60)
W=#Width#
H=104

[MeasureScroll]
Measure=Calc
Formula=( MeasureScroll + #Speed# )
IfCondition=(#CURRENTSECTION#>=([BottomText2:W]-#Width#))
IfTrueAction=[!CommandMeasure "MeasureTitleIn" "Stop 1"][!DisableMeasure "MeasureScroll"][!SetVariable Step "0"][!UpdateMeasure "MeasureTitleIn"][!CommandMeasure "MeasureTitleIn" "Execute 1"]
DynamicVariables=1
Disabled=1

[TopText]
Meter=String
MeterStyle=styleTextMajor
MeasureName=#topText##MusicSwitch#
X=(-[MeasureScroll])
Y=(#skinSize#/10)
ClipStringW=#Width#
ClipStringH=(#skinSize#/10)
ClipString=0
FontFace=#thinFont#
Text="%1" 
StringAlign=#mediaTextAlignment#
Container=MeterContainer
DynamicVariables=1

[BottomText]
Meter=String 
MeterStyle=styleTextMajor
MeasureName=MeasureTitleSc
X=r
Y=R
FontFace=#thickFont#
Text="%1" 
StringAlign=#mediaTextAlignment#
Container=MeterContainer

[BottomText2]
Meter=String 
MeasureName=MeasureTitleSc
X=0r
Y=0R
FontSize=(#skinSize#*0.0625)
FontColor=0,0,0,1
AntiAlias=1
Group=Visible
FontFace=#thickFont#
Text=%1
StringAlign=#mediaTextAlignment#

;[TopText]
;Meter=String
;MeterStyle=styleTextMajor
;MeasureName=#topText##MusicSwitch#
;X=#topTextPositionHor#
;Y=(#skinSize#*0.14)
;FontFace=#thinFont#
;Text="%1" 
;StringAlign=#mediaTextAlignment#

;[BottomText]
;Meter=String 
;MeterStyle=styleTextMajor
;MeasureName=#bottomText##MusicSwitch#
;X=r
;Y=R
;FontFace=#thickFont#
;Text="%1" 
;StringAlign=#mediaTextAlignment#

[Time]
Meter=STRING
MeterStyle=styleTextMini
MeasureName=mPosition#MusicSwitch#
MeasureName2=mLength#MusicSwitch#
X=#nowTextPositionHor#
Y=(#skinSize#*0.02)
Text="%1/%2"
UpdateDivider=4

[Progress]
Meter=String
MeterStyle=styleTextMini
MeasureName=mProgress#MusicSwitch#W
X=r
Y=(#skinSize#*0.0465)
Text="%1%"

[Play]
MeterStyle=styleTextControls
Meter=String
MeasureName=mStateButton#MusicSwitch#
X=#playCtrlPositionHor#
Y=(#skinSize#*0.2)
Text="%1"
LeftMouseUpAction=!CommandMeasure "m#playerController#" "PlayPause"
UpdateDivider=4
SolidColor=0,0,0,1

[Previous]
MeterStyle=styleTextControls
Meter=String
X=#nowTextPositionHor#
Y=(#skinSize#*0.17)
Text="previous"
LeftMouseUpAction=!CommandMeasure "m#playerController#" "Previous"
UpdateDivider=-1

[Next]
MeterStyle=styleTextControls
Meter=String
X=#nowTextPositionHor#
Y=(#skinSize#*0.2)
Text="next"
LeftMouseUpAction=!CommandMeasure "m#playerController#" "Next"
UpdateDivider=-1
SolidColor=0,0,0,1

[Settings]
Meter=String
MeterStyle=styleTextMini
FontColor=#translucent#
X=#settingsTextPositionHor#
Y=(#skinSize#*0.0465)
Text="settings"
MouseActionCursor=1
LeftMouseUpAction=!ActivateConfig "Cleartext\Settings"
UpdateDivider=-1
This code has the same problem as described previously: the title and the artist are scrolled together, accordingly to the width of the title. As said, this will be later improved, to get distinct scrolling of the artist only if it has a long name and scrolling of title if this one is long. This approach as well has checking purpose.
Please test the above solution and let me know if it matches your needs and you wanna me to furtherly work with it.
User avatar
Yincognito
Rainmeter Sage
Posts: 7330
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Scrolling text

Post by Yincognito »

Crash wrote: April 7th, 2020, 3:54 pmDon't stress it! I appreciate all the work you do and I can wait for it to be done to get it! Take your time, I have other things I've been working on in the meantime and I understand you have a life outside of rainmeter stuffs, the fact that you are helping me I'm super gratefull for already, don't stress any dates!
balala wrote: April 8th, 2020, 6:09 pmAlright, fixed this as well. It took a while, but finally I hope I did it.
Ok, so apparently me and balala are twins LOL, as we both seem to finish things simultaneously (no pun intended, LMAO). My version of the code, which has everything that you need:
- scrolling if whichever of the artist or title is greater than the width of the container
- eating out the characters like in the clip you posted, i.e. from left to right, right after finishing scrolling (if there's any scroll, that is, since "shorter" artist+title tuples than the width of the container won't scroll, obviously)
- it attempts to "detect" when the song has been changed, in order to start scrolling and then eating out chars on every song change

The code:

Code: Select all

[Rainmeter]
Update=1000
MouseOverAction=[!ShowMeterGroup Hover][!ShowMeterGroup #stowAwayName#][!Redraw]
MouseLeaveAction=[!HideMeterGroup Hover][!HideMeterGroup #stowAwayName#][!Redraw]
AccurateText=1
DynamicWindowSize=1
SkinHeight=(#skinSize#*0.25)

ContextTitle=Open Settings panel
ContextAction=!ActivateConfig "Cleartext\Settings"
ContextTitle2=Use Cleartext Pure
ContextAction2=!ActivateConfig "Cleartext"

[Metadata]
Name=Cleartext
Author=Redsaph
Description=Displays track information from various media players.
Version=5.2
License=Creative Commons BY-NC-SA 3.0

[Variables]
@include=#@#base.ini
currentlySetAlign=right
Width=300
Speed=5
EatCharUpdate=150
IntegralTopTextWidth=0
IntegralBottomTextWidth=0

; STYLES ==========================================
[styleTextControls]
FontFace=#controlsFont#
FontSize=(#skinSize#*0.027)
AntiAlias=1
FontColor=#translucent#
StringAlign=#interfaceTextAlignment#
DynamicVariables=1
Hidden=1
Group=Hover | Visible
MouseActionCursor=1

[styleTextMini]
FontFace=#controlsFont#
FontSize=(#skinSize#*0.0175)
AntiAlias=1
FontColor=#opaque#
StringAlign=#interfaceTextAlignment#
DynamicVariables=1
Hidden=1
Group=Hover | Visible

[styleTextMajor]
H=(#skinSize#*0.085)
FontSize=(#skinSize#*0.0625)
FontColor=#opaque#
AntiAlias=1
Group=Visible

; =================================================
; Measures

[LuaSettings]
Measure=Script
ScriptFile=#@#settings.lua

[mLastTexts]
Measure=String
String=""
DynamicVariables=1

[mTexts]
Measure=String
String="[#topText##MusicSwitch#] - [#bottomText##MusicSwitch#], [mLength#MusicSwitch#]"
IfMatch=^[mLastTexts:EscapeRegExp]$
IfNotMatchAction=[!DisableMeasure "MeasureScroll"][!UpdateMeasure "MeasureScroll"][!DisableMeasure "MeasureEatTopTextChars"][!UpdateMeasure "MeasureEatTopTextChars"][!DisableMeasure "MeasureEatBottomTextChars"][!UpdateMeasure "MeasureEatBottomTextChars"][!SetOption IntegralTopText Text "[#topText##MusicSwitch#]"][!UpdateMeter IntegralTopText][!SetOption IntegralBottomText Text "[#bottomText##MusicSwitch#]"][!UpdateMeter IntegralBottomText][!SetOption TopText Text "[#topText##MusicSwitch#]"][!UpdateMeter TopText][!SetOption BottomText Text "[#bottomText##MusicSwitch#]"][!UpdateMeter BottomText][!SetOption MeasureEatTopTextChars String "[#topText##MusicSwitch#]"][!UpdateMeasure "MeasureEatTopTextChars"][!SetOption MeasureEatBottomTextChars String "[#bottomText##MusicSwitch#]"][!UpdateMeasure "MeasureEatBottomTextChars"][!SetOption mLastTexts String "[mTexts]"][!UpdateMeasure "mLastTexts"][!EnableMeasure "MeasureScroll"]
IfMatchMode=1
DynamicVariables=1

[mTopTextWidth]
Group=AlignmentMeasure
Measure=Calc
Formula=[TopText:W]
OnChangeAction=[!WriteKeyValue Variables topTextWidth "[mTopTextWidth]" "#@#variables.inc"]
DynamicVariables=1

[mBottomTextWidth]
Group=AlignmentMeasure
Measure=Calc
Formula=[BottomText:W]
OnChangeAction=[!WriteKeyValue Variables bottomTextWidth "[mBottomTextWidth]" "#@#variables.inc"][!CommandMeasure "LuaAlign" "alignRightOnUpdate()"]
DynamicVariables=1

[LuaAlign]
Measure=Script
ScriptFile=#@#align.lua
UpdateDivider=8
DynamicVariables=1

[MeasureScroll]
Disabled=1
Measure=Calc
Formula=((MeasureScroll+#Speed#)>=(Max(#IntegralTopTextWidth#,#IntegralBottomTextWidth#)-#Width#)?(MeasureScroll):(MeasureScroll+#Speed#))
OnUpdateAction=[!SetOption TopText X "(#IntegralTopTextWidth#-[MeasureScroll])"][!UpdateMeter TopText][!SetOption BottomText X "(#IntegralBottomTextWidth#-#IntegralTopTextWidth#)r"][!UpdateMeter BottomText][!Redraw]
IfCondition=((MeasureScroll+#Speed#)>=(Max(#IntegralTopTextWidth#,#IntegralBottomTextWidth#)-#Width#)) && (mTopTextWidth<>0)
IfTrueAction=[!EnableMeasure "MeasureEatTopTextChars"]
IfCondition2=((MeasureScroll+#Speed#)>=(Max(#IntegralTopTextWidth#,#IntegralBottomTextWidth#)-#Width#)) && (mBottomTextWidth<>0)
IfTrueAction2=[!EnableMeasure "MeasureEatBottomTextChars"]
IfConditionMode=1
DynamicVariables=1

[MeasureEatTopTextChars]
Disabled=1
Measure=String
String=""
UpdateDivider=(#EatCharUpdate#/50)
RegExpSubstitute=1
Substitute="^.{1}(.*)$":"\1","^\\1$":""
IfMatch=^$
IfMatchAction=[!SetOption TopText Text ""][!UpdateMeter "TopText"][!DisableMeasure "MeasureEatTopTextChars"][!UpdateMeasure "MeasureEatTopTextChars"]
IfNotMatchAction=[!SetOption MeasureEatTopTextChars String "[MeasureEatTopTextChars]"][!SetOption TopText Text "[MeasureEatTopTextChars]"][!UpdateMeter "TopText"]
IfMatchMode=1
DynamicVariables=1

[MeasureEatBottomTextChars]
Disabled=1
Measure=String
String=""
UpdateDivider=(#EatCharUpdate#/50)
RegExpSubstitute=1
Substitute="^.{1}(.*)$":"\1","^\\1$":""
IfMatch=^$
IfMatchAction=[!SetOption BottomText Text ""][!UpdateMeter "BottomText"][!DisableMeasure "MeasureEatBottomTextChars"][!UpdateMeasure "MeasureEatBottomTextChars"]
IfNotMatchAction=[!SetOption MeasureEatBottomTextChars String "[MeasureEatBottomTextChars]"][!SetOption BottomText Text "[MeasureEatBottomTextChars]"][!UpdateMeter "BottomText"]
IfMatchMode=1
DynamicVariables=1

; =================================================
; Meters

[Background]
Meter=Image
X=0
Y=0
W=((#skinSize# > #lastSetWidth#) ? (#skinSize#+(#skinSize#*0.35)) : (#lastSetWidth#+(#skinSize#*0.35)))
H=(#skinSize#*0.25)
SolidColor=0,0,0,1
DynamicVariables=1
Group=Visible

[Now]
Meter=String
Text=Now
StringCase=Upper
StringAlign=#interfaceTextAlignment#
FontSize=(#skinSize#*0.03)
FontColor=#opaque#
X=#nowTextPositionHor#
Y=(#skinSize#*0.09)
AntiAlias=1
FontFace=#controlsFont#
UpdateDivider=-1
Hidden=#stowAway#
Group=Stow | Visible

[Playing]
Meter=String
Text=Playing
StringCase=Upper
StringAlign=#interfaceTextAlignment#
FontSize=(#skinSize#*0.03)
FontColor=#opaque#
X=r
Y=(#skinSize#*0.125)
AntiAlias=1
FontFace=#controlsFont#
UpdateDivider=-1
Hidden=#stowAway#
Group=Stow | Visible

[Hairline]
Meter=Bar
MeasureName=mProgress#MusicSwitch#P
X=#hairlinePositionHor#
W=(#skinSize#*0.005)
H=(#skinSize#*0.25)
BarColor=#over#
SolidColor=#opaque#
BarOrientation=Vertical
ToolTipText="Progress Bar"
UpdateDivider=4
Hidden=#stowAway#
Group=Stow | Visible

[MeterContainer]
Meter=Image
SolidColor=0,0,0,255
X=#topTextPositionHor#
Y=(#skinSize#*0.14-60)
W=#Width#
H=104

[IntegralTopText]
Container=MeterContainer
Meter=String
MeterStyle=styleTextMajor
FontFace=#thinFont#
FontColor=0,0,0,0
StringAlign=Left
X=0
Y=(#skinSize#/10)
Text="[#topText##MusicSwitch#]"
OnUpdateAction=[!SetVariable IntegralTopTextWidth [IntegralTopText:W]]
DynamicVariables=1

[IntegralBottomText]
Container=MeterContainer
Meter=String
MeterStyle=styleTextMajor
FontFace=#thickFont#
FontColor=0,0,0,0
StringAlign=Left
X=0
Y=R
Text="[#bottomText##MusicSwitch#]"
OnUpdateAction=[!SetVariable IntegralBottomTextWidth [IntegralBottomText:W]]
DynamicVariables=1

[TopText]
Meter=String
MeterStyle=styleTextMajor
X=(#IntegralTopTextWidth#-[MeasureScroll])
Y=[IntegralTopText:Y]
ClipStringW=#Width#
ClipStringH=(#skinSize#/10)
ClipString=0
FontFace=#thinFont#
Text="[#topText##MusicSwitch#]"
StringAlign=Right
Container=MeterContainer
OnUpdateAction=[!SetVariable TopTextWidth [TopText:W]]
DynamicVariables=1

[BottomText]
Meter=String 
MeterStyle=styleTextMajor
X=(#IntegralBottomTextWidth#-#IntegralTopTextWidth#)r
Y=R
ClipStringW=#Width#
ClipStringH=(#skinSize#/10)
ClipString=0
FontFace=#thickFont#
Text="[#bottomText##MusicSwitch#]"
StringAlign=Right
Container=MeterContainer
OnUpdateAction=[!SetVariable BottomTextWidth [BottomText:W]]
DynamicVariables=1

[Time]
Meter=STRING
MeterStyle=styleTextMini
MeasureName=mPosition#MusicSwitch#
MeasureName2=mLength#MusicSwitch#
X=#nowTextPositionHor#
Y=(#skinSize#*0.02)
Text="%1/%2"
UpdateDivider=4

[Progress]
Meter=String
MeterStyle=styleTextMini
MeasureName=mProgress#MusicSwitch#W
X=r
Y=(#skinSize#*0.0465)
Text="%1%"

[Play]
MeterStyle=styleTextControls
Meter=String
MeasureName=mStateButton#MusicSwitch#
X=#playCtrlPositionHor#
Y=(#skinSize#*0.2)
Text="%1"
LeftMouseUpAction=!CommandMeasure "m#playerController#" "PlayPause"
UpdateDivider=4
SolidColor=0,0,0,1

[Previous]
MeterStyle=styleTextControls
Meter=String
X=#nowTextPositionHor#
Y=(#skinSize#*0.17)
Text="previous"
LeftMouseUpAction=!CommandMeasure "m#playerController#" "Previous"
UpdateDivider=-1

[Next]
MeterStyle=styleTextControls
Meter=String
X=#nowTextPositionHor#
Y=(#skinSize#*0.2)
Text="next"
LeftMouseUpAction=!CommandMeasure "m#playerController#" "Next"
UpdateDivider=-1
SolidColor=0,0,0,1

[Settings]
Meter=String
MeterStyle=styleTextMini
FontColor=#translucent#
X=#settingsTextPositionHor#
Y=(#skinSize#*0.0465)
Text="settings"
MouseActionCursor=1
LeftMouseUpAction=!ActivateConfig "Cleartext\Settings"
UpdateDivider=-1
Drawbacks:
- for some reason, the artist and title show up starting with the 2nd "row" in the skin - I'm not sure why this happens or whether there are things on the 3rd "row" that are messed by this behavior. I suppose it could be corrected by changing the Y, but I don't want to do things without first understand why the issue happens in the first place
- the scroll doesn't start exactly at position "0", but adds one instance of #Speed# right from the start (the issue with counters starting at 0, balala knows)
- there aren't any "pauses" before the scroll or the char eating, so there are small chances to see the text for longer before it starts the animation

Maybe balala can help with these drawbacks, hopefully. There is 95% of the things that are done in this version, but some pauses before starting with the 2 animations would really help, visually. I'm not entirely sure a [!Delay ...] bang would be the most appropriate in this case (there are some minor artefacts when trying that - although they're not that serious, and could be considered "additional effects" if one is lenient).
Last edited by Yincognito on April 8th, 2020, 7:06 pm, edited 1 time in total.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7330
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Scrolling text

Post by Yincognito »

balala wrote: April 8th, 2020, 6:09 pmThis code has the same problem as described previously: the title and the artist are scrolled together, accordingly to the width of the title. As said, this will be later improved, to get distinct scrolling of the artist only if it has a long name and scrolling of title if this one is long. This approach as well has checking purpose.
Please test the above solution and let me know if it matches your needs and you wanna me to furtherly work with it.
Well, not trying to look for problems where there are none, but I tried your code and it didn't scroll at all. It only displays the (static) title. By comparison, your previous code (which I used as the starting base for mine) scrolled perfectly.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth