CodeCode wrote: ↑November 21st, 2023, 11:42 am
Yep. SO that option was indeed explored. I tried this
OnRefreshAction=[!SetWindowPosition "50%" "-100%" "50%" "0%"] as well. I dont think it matters but the Y position is actually -100%.
Still, the only actual issue is consistent centering of the text and thereby6 the rest of the skin should follow - but it doesnt.
I'll figure it out.
Thanks.
Oh, now I see what you mean: you want to synchronize the display of text and images on track changes, since the coordinates of the latter depend on the former. I thought that was a "feature" of your skin and kinda liked it, lol. Anyway, the problem here is the order of meters: you try to compute the coordinates of a meter (e.g. [CentreAbove]) based on the coordinates of another meter placed AFTER the first one (e.g. [CentreText]). That means the values computed in the former need an additional skin update to get the values from the latter, since a measure / meter can only know what's BEFORE it during the same update cycle.
One solution would be to duplicate an invisible [CentreText] before [CentreAbove], so that the latter can use the dimensions of the former to calculate its own (did some other minor changes to the code):
Code: Select all
[Variables]
@include=#@#MainVariables.inc
[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
OnRefreshAction=[!SetWindowPosition "0" "0"]
---Measures---
[Artist]
Measure=NowPlaying
PlayerName=#Player#
PlayerType=Artist
Substitute="":"Artist"
DynamicVariables=1
[MeasureTrack]
Measure=NowPlaying
PlayerName=[Artist]
PlayerType=Title
Substitute="":"Title"
DynamicVariables=1
[MeasureBar]
Measure=NowPlaying
PlayerName=[Artist]
PlayerType=Progress
MinValue=0
MaxValue=100
DynamicVariables=1
[mDuration]
Measure=NowPlaying
PlayerName=[Artist]
PlayerType=DURATION
[mPosition]
Measure=NowPlaying
PlayerName=[Artist]
PlayerType=POSITION
[MinRemaining]
Measure=Calc
Formula=trunc((mDuration - mPosition)/60)
RegExpSubstitute=1
DynamicVariables=1
[SecRemaining]
Measure=Calc
Formula=((mDuration - mPosition) % 60)
RegExpSubstitute=1
Substitute="^(.)$":"0\1"
DynamicVariables=1
---Meters---
[CentreText]
Meter=String
MeasureName=Artist
MeasureName2=MeasureTrack
X=(#SCREENAREAWIDTH#/2)
Y=5
StringAlign=Center
StringCase=Lower
Text=%1 - %2
StringEffect=Border
FontEffectColor=0,0,0,0
SolidColor=0,0,0,0
FontColor=0,0,0,0
FontFace=#ReportFont#
FontSize=25
DynamicVariables=1
[CentreAbove]
Meter=Image
ImageName=#@#Centre Above.png
ImageTint=#VolMain#
ImageAlpha=150
X=(([CentreText:X] - [ScrollL:W]) - 94)
Y=2
W=(([CentreText:W] + [ScrollL:W] + [ScrollR:W]) + 94 * 2)
H=100
DynamicVariables=1
[CentreTextVisible]
Meter=String
MeasureName=Artist
MeasureName2=MeasureTrack
X=(#SCREENAREAWIDTH#/2)
Y=5
StringAlign=Center
StringCase=Lower
Text=%1 - %2
StringEffect=Border
FontEffectColor=0,0,0,255
SolidColor=0,0,0,1
FontColor=#AltColor#
FontFace=#ReportFont#
FontSize=25
DynamicVariables=1
[ScrollL]
Meter=Image
ImageName=#@#Edge.png
ImageFlip=None
ImageTint=#MainColor#
X=([CentreText:X]-[ScrollL:W] - 10)
Y=2
W=165
H=38
DynamicVariables=1
Hidden=0
[ScrollR]
Meter=Image
ImageName=#@#Edge.png
ImageFlip=Horizontal
ImageTint=#MainColor#
X=([CentreText:X]+[CentreText:W] + 10)
Y=r
W=165
H=38
DynamicVariables=1
Hidden=0
[ProgressBar]
Meter=Shape
X=[CentreText:X]
Y=0r
Shape=Rectangle 0,0,([CentreText:W]),9,2 | Fill Color 0,0,0,255 | StrokeWidth 1 | Stroke Color #VolMain#
Shape2=Rectangle 0,0,(([MeasureBar]*[CentreText:W])/100),9,2 | StrokeWidth 0 | Fill LinearGradient MyGradient
MyGradient=180 | 0,71,130,180; 0 | 0,146,205,180; 0.79 | 25,246,255,180; 0.99
DynamicVariables=1
AntiAlias=1
[ProgressText]
Meter=String
MeasureName=mPosition
SolidColor=0,0,0,1
FontFace=Calibri
FontSize=10
FontColor=#TotalbColor#
StringAlign=Left
X=([CentreText:X]-[ProgressText:W])-3
Y=-3r
Text=%1
DynamicVariables=1
[DurationText]
Meter=String
MeasureName=mDuration
SolidColor=0,0,0,1
FontFace=Calibri
FontSize=10
FontColor=#TotalbColor#
StringAlign=Left
X=([CentreText:X]+[CentreText:W])+3
Y=r
Text=%1
DynamicVariables=1