It is currently June 26th, 2024, 10:10 am

Scrolling text

Get help with creating, editing & fixing problems with skins
Crash
Posts: 47
Joined: February 12th, 2020, 1:53 am

Re: Scrolling text

Post by Crash »

I belive I'm using the lates rainmeter final release, However My pc has been very jank with rainmeter in past so I'll attribute it to that lol
User avatar
Yincognito
Rainmeter Sage
Posts: 7522
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Scrolling text

Post by Yincognito »

Crash wrote: April 9th, 2020, 2:35 pm I added this and while the text is a tad high (Not centered) I can fix that myself, this code works like a charm and I can't thank you enough!
Ok, since I am a perfectionist, and also stubborn (not to mention disliking things that are not 100% done, LOL), here is my final version. As already posted before, this includes vertically centering those 2 lines with the artist and title within the container, correcting the scroll not proceeding until the very end pixel of the texts (the last #RegularSpeed# pixels - aka 3 px - weren't scrolled), but also fixes the exaggerated width of the skin compared to its current visible content. The small drawback (not exactly a drawback, but whatever) is that you can't set the width of the container by modifying the #Width# variable from the Cleartext.ini code anymore, but (and this is how it should be done in this skin, after all) the width is set using the "built-in" Settings skin (i.e. RESIZE / SCALE CLEARTEXT option from the menu). Be aware that after doing that, you should toggle one time between the Left and Right choices from ALIGN TEXT option in the menu, so that the skin has the chance of fully writing the needed variables in its files (for some reason, this doesn't happen completely when clicking OK after resizing the skin - I guess the developer forgot to do it for both alignments, hence the need to toggle them a bit after this change). Of course, you can also set the size of the skin using Rainmeter built-in variables (like (#SCREENAREAHEIGHT#*0.25), for example), besides using hardcoded values (like, say, 540).

Cleartext.ini:

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=#skinSize#
RegularSpeed=3
Speed=0
EatCharUpdate=150
IntegralTopTextWidth=0
IntegralBottomTextWidth=0
UpdatesAfterChangedSong=0
UpdatesUntilScroll=20
UpdatesAfterScrollEnd=0
UpdatesUntilEatChar=20

; 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#]"
IfCondition=(#UpdatesAfterChangedSong#=#UpdatesUntilScroll#)
IfTrueAction=[!SetVariable Speed (#RegularSpeed#)]
IfConditionMode=1
IfMatch=^[mLastTexts:EscapeRegExp]$
IfNotMatchAction=[!SetVariable UpdatesAfterChangedSong 0][!SetVariable UpdatesAfterScrollEnd 0][!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"][!SetVariable Speed 0][!EnableMeasure "MeasureScroll"]
IfMatchAction=[!SetVariable UpdatesAfterChangedSong (#UpdatesAfterChangedSong#+1)]
IfMatchMode=1
DynamicVariables=1

[mTopTextWidth]
Group=AlignmentMeasure
Measure=Calc
Formula=(#Width#)
UpdateDivider=-1
OnUpdateAction=[!WriteKeyValue Variables topTextWidth "[mTopTextWidth]" "#@#variables.inc"]
DynamicVariables=1

[mBottomTextWidth]
Group=AlignmentMeasure
Measure=Calc
Formula=(#Width#)
UpdateDivider=-1
OnUpdateAction=[!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#))
IfTrueAction=[!SetVariable UpdatesAfterScrollEnd (#UpdatesAfterScrollEnd#+1)]
IfCondition2=(#UpdatesAfterScrollEnd#=#UpdatesUntilEatChar#)
IfTrueAction2=[!EnableMeasure "MeasureEatTopTextChars"][!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#-#alignRight#*#Width#)
Y=0
W=#Width#
H=(#skinSize#*0.25)
DynamicVariables=1

[IntegralTopText]
Container=MeterContainer
Meter=String
MeterStyle=styleTextMajor
FontFace=#thinFont#
FontColor=0,0,0,0
StringAlign=Left
X=0
Y=((#skinSize#*0.25-([IntegralTopText:H]+[IntegralBottomText:H]))/2)
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]
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
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
So, what happens is that #Width# will actually be #skinSize#, and since almost everything is based on the latter's value, things work smoothly (I already tried using different resolutions, and it behaves as it should - bar the required text alignment toggle I mentioned above). I had to trick the lame Lua code and pass the #Width# (aka #skinSize#) value to it instead of the actual artist and title texts' full widths, so that it won't forcefully redimension the skin according to those (hypothetically, large) values, like it happened in the original code. Of course, the #Width# variable became practically obsolete in this version, as I could have directly used #skinSize# instead (a simple matter of Replace in Notepad++), but didn't bothered doing it - in the end I think that things are clearer this way in the code.
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 10th, 2020, 1:42 pm Ok, since I am a perfectionist, and also stubborn (not to mention disliking things that are not 100% done, LOL), here is my final version. As already posted before, this includes vertically centering those 2 lines with the artist and title within the container, correcting the scroll not proceeding until the very end pixel of the texts (the last #RegularSpeed# pixels - aka 3 px - weren't scrolled), but also fixes the exaggerated width of the skin compared to its current visible content. The small drawback (not exactly a drawback, but whatever) is that you can't set the width of the container by modifying the #Width# variable from the Cleartext.ini code anymore, but (and this is how it should be done in this skin, after all) the width is set using the "built-in" Settings skin (i.e. RESIZE / SCALE CLEARTEXT option from the menu). Be aware that after doing that, you should toggle one time between the Left and Right choices from ALIGN TEXT option in the menu, so that the skin has the chance of fully writing the needed variables in its files (for some reason, this doesn't happen completely when clicking OK after resizing the skin - I guess the developer forgot to do it for both alignments, hence the need to toggle them a bit after this change). Of course, you can also set the size of the skin using Rainmeter built-in variables (like (#SCREENAREAHEIGHT#*0.25), for example), besides using hardcoded values (like, say, 540).

Cleartext.ini:

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=#skinSize#
RegularSpeed=3
Speed=0
EatCharUpdate=150
IntegralTopTextWidth=0
IntegralBottomTextWidth=0
UpdatesAfterChangedSong=0
UpdatesUntilScroll=20
UpdatesAfterScrollEnd=0
UpdatesUntilEatChar=20

; 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#]"
IfCondition=(#UpdatesAfterChangedSong#=#UpdatesUntilScroll#)
IfTrueAction=[!SetVariable Speed (#RegularSpeed#)]
IfConditionMode=1
IfMatch=^[mLastTexts:EscapeRegExp]$
IfNotMatchAction=[!SetVariable UpdatesAfterChangedSong 0][!SetVariable UpdatesAfterScrollEnd 0][!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"][!SetVariable Speed 0][!EnableMeasure "MeasureScroll"]
IfMatchAction=[!SetVariable UpdatesAfterChangedSong (#UpdatesAfterChangedSong#+1)]
IfMatchMode=1
DynamicVariables=1

[mTopTextWidth]
Group=AlignmentMeasure
Measure=Calc
Formula=(#Width#)
UpdateDivider=-1
OnUpdateAction=[!WriteKeyValue Variables topTextWidth "[mTopTextWidth]" "#@#variables.inc"]
DynamicVariables=1

[mBottomTextWidth]
Group=AlignmentMeasure
Measure=Calc
Formula=(#Width#)
UpdateDivider=-1
OnUpdateAction=[!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#))
IfTrueAction=[!SetVariable UpdatesAfterScrollEnd (#UpdatesAfterScrollEnd#+1)]
IfCondition2=(#UpdatesAfterScrollEnd#=#UpdatesUntilEatChar#)
IfTrueAction2=[!EnableMeasure "MeasureEatTopTextChars"][!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#-#alignRight#*#Width#)
Y=0
W=#Width#
H=(#skinSize#*0.25)
DynamicVariables=1

[IntegralTopText]
Container=MeterContainer
Meter=String
MeterStyle=styleTextMajor
FontFace=#thinFont#
FontColor=0,0,0,0
StringAlign=Left
X=0
Y=((#skinSize#*0.25-([IntegralTopText:H]+[IntegralBottomText:H]))/2)
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]
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
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
So, what happens is that #Width# will actually be #skinSize#, and since almost everything is based on the latter's value, things work smoothly (I already tried using different resolutions, and it behaves as it should - bar the required text alignment toggle I mentioned above). I had to trick the lame Lua code and pass the #Width# (aka #skinSize#) value to it instead of the actual artist and title texts' full widths, so that it won't forcefully redimension the skin according to those (hypothetically, large) values, like it happened in the original code. Of course, the #Width# variable became practically obsolete in this version, as I could have directly used #skinSize# instead (a simple matter of Replace in Notepad++), but didn't bothered doing it - in the end I think that things are clearer this way in the code.
Sorry for the late reply, This works like a charm! Thank you both so much! I might ask some questions at a later date about the functions behind this, but first I want to finish my wallpaper skin lol.
User avatar
Yincognito
Rainmeter Sage
Posts: 7522
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Scrolling text

Post by Yincognito »

Crash wrote: April 11th, 2020, 11:05 amI might ask some questions at a later date about the functions behind this, but first I want to finish my wallpaper skin lol.
You should do it now, or as soon as possible though, because if you delay those questions for too long, I might "clear my head" of all the reasons why I did this and that in the skin. That's the way I work, no meaningless information is kept longer than necessary in my brain... :D
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16342
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Scrolling text

Post by balala »

Yincognito wrote: April 11th, 2020, 11:09 am You should do it now, or as soon as possible though, because if you delay those questions for too long, I might "clear my head" of all the reasons why I did this and that in the skin. That's the way I work, no meaningless information is kept longer than necessary in my brain... :D
:thumbup: Very true!!! Usually my case as well! :thumbup:
User avatar
Yincognito
Rainmeter Sage
Posts: 7522
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Scrolling text

Post by Yincognito »

balala wrote: April 11th, 2020, 3:47 pm :thumbup: Very true!!! Usually my case as well! :thumbup:
Yep. I had to spend a couple of days remembering what I did (and why I did it) in my very own skins (!!!) when rewriting them because of the wxdata.com problem at the start of this year. Such information gets lost with time, since it's of no immediate benefit. I can fully understand fonpaolo who admitted he's more like a beginner nowadays, simply because he didn't work with such things very often in recent time.
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 11th, 2020, 11:09 am You should do it now, or as soon as possible though, because if you delay those questions for too long, I might "clear my head" of all the reasons why I did this and that in the skin. That's the way I work, no meaningless information is kept longer than necessary in my brain... :D
Haha, I get that feeling, it's getting late here so i'll probably ask tomorrow or monday, huge thanks again both of you!
Crash
Posts: 47
Joined: February 12th, 2020, 1:53 am

Re: Scrolling text

Post by Crash »

Sorry for the super late reply, had a bunch of personal stuff come up. Looking through it I think I understand everything, the stuff I was unsure of the documentation clarified for me, thanks a whole bunch again!
User avatar
Yincognito
Rainmeter Sage
Posts: 7522
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Scrolling text

Post by Yincognito »

Crash wrote: April 20th, 2020, 4:22 pm Sorry for the super late reply, had a bunch of personal stuff come up. Looking through it I think I understand everything, the stuff I was unsure of the documentation clarified for me, thanks a whole bunch again!
No problem. Enjoy! ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth