It is currently May 6th, 2024, 12:20 am

Scrolling text

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

Re: Scrolling text

Post by Yincognito »

New code, it should work if you set the text alignment to Right in Settings as well, and also attempts to correct the Y/H issue - please confirm:

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
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=[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#))
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=0
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
Crash wrote: April 9th, 2020, 11:58 am The Y still seems to be a bit off, but the X is just fine, could it be a monitor resoultion issue? I have 2, one thats 1920 by 1080 and another thats the main one thats 1920 by 1200.
e6da7bef8af9e8c85117c03013760a33.mp4
I think you're right - very good catch. :thumbup: I modified the container position and height accordingly, it should work now - let me know if it does (or doesn't).

One other thing that should be corrected is the width of the whole skin. It is way too wide (you can see when hovering with the mouse over the area around the texts), and I guess it has something to do with the W formula in the [Background] meter above, but also (and this is way more problematic), with the processes happening in the align.lua file from the package. Maybe balala can help with that better than I do, as Lua is not exactly my field of "expertise".

EDIT: If (and when) the exaggerated width of the skin (probably due to the .lua files setting it according to the maximum width between the full artist and title texts) is corrected, the X of [MeterContainer] should be set to X=((1-#alignRight#)*#topTextPositionHor#). In that hypothetical case, the width of the skin should be (#topTextPositionHor#+#Width#) (where #topTextPositionHor# is the width of the little NOW PLAYING panel that reacts on hover and #Width# is the width of the container where the artist and title are scrolling). This is because the skin was originally made to adapt itself to the width of the entire content of both the artist and the title, but after the implementation of scrolling / char eating, the visible content of artist and title is restricted to the container's width.
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 9th, 2020, 12:45 pm New code, it should work if you set the text alignment to Right in Settings as well, and also attempts to correct the Y/H issue - please confirm:

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
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=[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#))
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=0
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


I think you're right - very good catch. :thumbup: I modified the container position and height accordingly, it should work now - let me know if it does (or doesn't).

One other thing that should be corrected is the width of the whole skin. It is way too wide (you can see when hovering with the mouse over the area around the texts), and I guess it has something to do with the W formula in the [Background] meter above, but also (and this is way more problematic), with the processes happening in the align.lua file from the package. Maybe balala can help with that better than I do, as Lua is not exactly my field of "expertise".

EDIT: If (and when) the exaggerated width of the skin (probably due to the .lua files setting it according to the maximum width between the full artist and title texts) is corrected, the X of [MeterContainer] should be set to X=((1-#alignRight#)*#topTextPositionHor#). In that hypothetical case, the width of the skin should be (#topTextPositionHor#+#Width#) (where #topTextPositionHor# is the width of the little NOW PLAYING panel that reacts on hover and #Width# is the width of the container where the artist and title are scrolling). This is because the skin was originally made to adapt itself to the width of the entire content of both the artist and the title, but after the implementation of scrolling / char eating, the visible content of artist and title is restricted to the container's width.
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!
User avatar
Yincognito
Rainmeter Sage
Posts: 7203
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!
You're welcome. ;-) By the way, as you probably realized, increasing the Y and decreasing the H of the [MeterContainer] (obviously, using #skinSize# multiplication factors) can help you center it vertically in the skin (I didn't know you preferred it that way, after all), but there is also another way, which is increasing (also using multiplication factors of #skinSize#) the Y of [IntegralTopText]. For the latter case, nothing else needs modification, as all the other 3 instances of text below [IntegralTopText] base their vertical position on this.

Also, you should be aware that if you don't accordingly include the H of [IntegralTopText] and [IntegralBottomText] in calculating their (or the container's) vertically "centered" position, changing the font (or the font size) of the artist or title will mess up their centering a bit.

Enjoy the skin! 8-)

EDIT: Just thought you could use this Y set on [IntegralTopText] (as mentioned, nothing else needs modification):

Code: Select all

Y=((#skinSize#*0.25-([IntegralTopText:H]+[IntegralBottomText:H]))/2)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16200
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Scrolling text

Post by balala »

Yincognito wrote: April 9th, 2020, 9:53 am See the edit of my previous post - what do you think?
Not sure what have you edited in your last post. Added the PS?
If you did, I don't really understand why do you change the alignment or the position of the strings? I left them as they were, didn't updated this part of the code. Not sure why this should be done. Did I miss something?
User avatar
balala
Rainmeter Sage
Posts: 16200
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Scrolling text

Post by balala »

Crash wrote: April 9th, 2020, 11:03 am My issue with Yincognitos is that eveything is just not aligned correctly, but the text eating and scrolling works,
https://drive.google.com/open?id=1MRjkeQ0_ZDK6qimwucS08MVw0faB-dan
Should be the right link, this is the one Balala posted before, I probably just made a stupid slip up heh
This skin is perfectly working for me. Doesn't it for you? If not, I don't know what else to say. As said it works, see the attached animation, created using your skin:
GIF.gif
:confused: :confused: :confused:
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 7203
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Scrolling text

Post by Yincognito »

balala wrote: April 9th, 2020, 3:19 pm Not sure what have you edited in your last post. Added the PS?
If you did, I don't really understand why do you change the alignment or the position of the strings? I left them as they were, didn't updated this part of the code. Not sure why this should be done. Did I miss something?
Yes, it's the P.S.

In my case, I had to change the alignment and the position of the strings in the first place, since, as I mentioned here, I wanted to align them to the right from the start, so there isn't any weird movement when chars were eaten due to left alignment (this happened, for example, in my first posted code).

That being said, in general there are some positional changes done in the background (through refreshes, Lua or both) and that sometimes makes new changes in Cleartext.ini have "unexpected results". I still think that the fact that your version didn't work was because the positioning was messed up by one of those things happening in the background... I mean, I don't know of any case where an ActionTimer code didn't work on someone's computer - and this, coupled with the fact that my version worked, can lead to only one conclusion: the process works in your case as well, it's just that it might not be visible. Especially since my version also required positions to be adjusted according to variable resolutions.

A simple example: in your original code here, you used hardcoded values to set the Y, W and H of [MeterContainer]. This was the cause for my version's wrong positioning on the OP's screen (as I based my version on yours, initially) ... and this might very well be the cause for the issue happening with your version (i.e. actual invisibility of the container content due to wrong positioning on another screen resolution?).
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16200
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Scrolling text

Post by balala »

Yincognito wrote: April 9th, 2020, 3:48 pm That being said, in general there are some positional changes done in the background (through refreshes, Lua or both) and that sometimes makes new changes in Cleartext.ini have "unexpected results". I still think that the fact that your version didn't work was because the positioning was messed up by one of those things happening in the background... I mean, I don't know of any case where an ActionTimer code didn't work on someone's computer - and this, coupled with the fact that my version worked, can lead to only one conclusion: the process works in your case as well, it's just that it might not be visible. Especially since my version also required positions to be adjusted according to variable resolutions.
You might be right, however it is weird that the skin posted by Crash works perfectly for me, but it doesn't for him. Right now I have no idea what to say...
Yincognito wrote: April 9th, 2020, 3:48 pm I mean, I don't know of any case where an ActionTimer code didn't work on someone's computer
This could happen if he is using an extremely old version of Rainmeter, one which doesn't include yet the ActionTimer plugin. This plugin has been added on version 3.3 of Rainmeter, released somewhere around December 2015, if I'm not wrong. So is he using a previous version of Rainmeter? Might this be true?
User avatar
balala
Rainmeter Sage
Posts: 16200
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Scrolling text

Post by balala »

Crash wrote: April 9th, 2020, 12:26 am I tried to install it from the skin you posted earlier tried a couple of players all to no avail. No scrolling and no album shown.
Accordingly to my previous post, what Rainmeter version are you using?
User avatar
Yincognito
Rainmeter Sage
Posts: 7203
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Scrolling text

Post by Yincognito »

balala wrote: April 9th, 2020, 4:11 pmThis could happen if he is using an extremely old version of Rainmeter, one which doesn't include yet the ActionTimer plugin. This plugin has been added on version 3.3 of Rainmeter, released somewhere around December 2015, if I'm not wrong. So is he using a previous version of Rainmeter? Might this be true?
I don't know. I somehow doubt it.
balala wrote: April 9th, 2020, 4:11 pmYou might be right, however it is weird that the skin posted by Crash works perfectly for me, but it doesn't for him. Right now I have no idea what to say...
Crash has a different resolution for the screen / monitor, and all of the dimensions in this skin are based on the values of these built-in variables. The changes below take care of that in the case of [MeterContainer]:

Code: Select all

[MeterContainer]
Meter=Image
SolidColor=0,0,0,255
X=(#topTextPositionHor#-#alignRight#*#Width#)
Y=0
W=#Width#
H=(#skinSize#*0.25)
DynamicVariables=1
Not surprisingly, after these changes, the thing works even if you set Align Text to Right in the Settings skin. Double benefit. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16200
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Scrolling text

Post by balala »

Yincognito wrote: April 9th, 2020, 4:19 pm I don't know. I somehow doubt it.
Definitely. However it's not completely impossible.