It is currently June 21st, 2021, 7:15 am

How do I format this to scale?

Get help with installing and using Rainmeter.
User avatar
Aethaerx
Posts: 8
Joined: March 24th, 2021, 9:48 pm

How do I format this to scale?

Post by Aethaerx »

I have the following code:

Code: Select all

Shape=Rectangle 0,0,#Width#,#Height#,(#Height#/2) | Extend MyModifiers2

Shape2=Rectangle 0,0,(#Width#*([MeasureProgress]-[MeasureProgress:MinValue]*(([MeasureProgress:MaxValue]-[MeasureProgress:MinValue]-[MeasureProgress])/([MeasureProgress:MaxValue]-[MeasureProgress:MinValue])))/([MeasureProgress:MaxValue]-[MeasureProgress:MinValue])),#Height#,(#Height#/2) | Extend MyModifiers1
...and I'm trying to add #Scale# to it so that the progress bar properly scales. I have added #Scale# to all my other values in my .ini file and everything scales properly I'm just unsure of the formatting for adding that to the above shape values. Can someone format that for me so I know how to do it?
User avatar
balala
Rainmeter Sage
Posts: 12807
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How do I format this to scale?

Post by balala »

Aethaerx wrote: March 25th, 2021, 7:58 pm I have the following code:

Code: Select all

Shape=Rectangle 0,0,#Width#,#Height#,(#Height#/2) | Extend MyModifiers2

Shape2=Rectangle 0,0,(#Width#*([MeasureProgress]-[MeasureProgress:MinValue]*(([MeasureProgress:MaxValue]-[MeasureProgress:MinValue]-[MeasureProgress])/([MeasureProgress:MaxValue]-[MeasureProgress:MinValue])))/([MeasureProgress:MaxValue]-[MeasureProgress:MinValue])),#Height#,(#Height#/2) | Extend MyModifiers1
...and I'm trying to add #Scale# to it so that the progress bar properly scales. I have added #Scale# to all my other values in my .ini file and everything scales properly I'm just unsure of the formatting for adding that to the above shape values. Can someone format that for me so I know how to do it?
Would be nice you to post the whole code of at least the meter which has the above two Shape options, however what you could try is to add something like this to the MyModifiers1 and myModifiers2 options: MyModifiers1=... | Scale #Scale#, #Scale# and MyModifiers2=... | Scale #Scale#, #Scale#. The Scale variable has to be defined into the [Variables] section or has to be set through a !SetVariable bang (note that in this last case the meter where is it used, needs a DynamicVariables=1 option as well).
User avatar
Aethaerx
Posts: 8
Joined: March 24th, 2021, 9:48 pm

Re: How do I format this to scale?

Post by Aethaerx »

I appreciate your help! I added what you mentioned in the code below (posting the full code this time) but it didn't quite work as intended. The bar scaled but as the skin scaled up the bar would move out of place.

Your code has been added to [MeterProgressShape]

Code: Select all

; --------------------------------------------------------------------------------------
[Rainmeter]
Update=1000
AccurateText=1
BackgroundMode=0
DynamicWindowSize=1
MouseScrollUpAction=[!SetVariable Scale "(#Scale#+#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#+#ScrollMouseIncrement#)"][!Refresh]
MouseScrollDownAction=[!SetVariable Scale "(#Scale#-#ScrollMouseIncrement# < 1 ? 1 : #Scale#-#ScrollMouseIncrement#)"][!WriteKeyValue Variables Scale "(#Scale#-#ScrollMouseIncrement# < 1 ? 1 : #Scale#-#ScrollMouseIncrement#)"][!Refresh]

[Variables]
Width=475
Height=9
BarColor=72d273
BackgroundColor=ffffff10
@include=#@#Variables.inc
Scale=1

[Metadata]
Name= -
Author= -
Information= -
Version= -
License=-

[MeasurePlayer]
Measure=NowPlaying
PlayerName=CAD
PlayerType=TITLE
Substitute="":"-"

[MeasureArtist]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=ARTIST
Substitute="":"-"

[MeasureCover]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=COVER

[MeasureProgress]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=PROGRESS

[MeasurePlayerState]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=STATE
Substitute="0":"#@#Images\Play.png","1":"#@#Images\Pause.png","2":"#@#Images\Play.png"

[MeasurePlayerShuffle]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=SHUFFLE
Substitute="0":"#@#Images\Shuffle.png","1":"#@#Images\ShuffleOn.png","2":"#@#Images\Shuffle.png"

[MeasurePlayerRepeat]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=REPEAT
Substitute="0":"#@#Images\Repeat.png","1":"#@#Images\RepeatOn.png","2":"#@#Images\Repeat.png"

[MeterBackground]
Meter=Image
ImageName=#@#Images\Player-Background.png
X=(0*#Scale#)
Y=(0*#Scale#)
W=(500*#Scale#)
AntiAlias=1

[MeterArtist]
Meter=STRING
StringAlign=Center
MeasureName=MeasureArtist
X=(250*#Scale#)
Y=(312*#Scale#)
W=(300*#Scale#)
H=(50*#Scale#)
FontFace=StagSans-Light
FontColor=FFFFFF
FontSize=(20*#Scale#)
AntiAlias=1
ClipString=1
Text="%1"

[MeterCover]
Meter=Image
ImageName=[MeasureCover]
MaskImageName=#@#Images\CoverMask.png
X=(0*#Scale#)
Y=(0*#Scale#)
W=(500*#Scale#)
H=(500*#Scale#)
DynamicVariables=1
AntiAlias=1

[MeterSongTitle]
Meter=STRING
StringAlign=Center
MeasureName=MeasurePlayer
X=(250*#Scale#)
Y=(352*#Scale#)
W=(300*#Scale#)
H=(20*#Scale#)
FontFace=StagSans-Medium
FontColor=FFFFFF
FontSize=(12*#Scale#)
AntiAlias=1
ClipString=1
Text="%1"

[MeterProgressShape]
Meter=Shape
X=(12*#Scale#)
Y=(288*#Scale#)
Shape=Rectangle 0,0,#Width#,#Height#,(#Height#/2) | Extend MyModifiers2
Shape2=Rectangle 0,0,(#Width#*([MeasureProgress]-[MeasureProgress:MinValue]*(([MeasureProgress:MaxValue]-[MeasureProgress:MinValue]-[MeasureProgress])/([MeasureProgress:MaxValue]-[MeasureProgress:MinValue])))/([MeasureProgress:MaxValue]-[MeasureProgress:MinValue])),#Height#,(#Height#/2) | Extend MyModifiers1
MyModifiers1=Fill Color #BarColor# | StrokeWidth 0 | Stroke Color 0,0,0,0 | Scale #Scale#, #Scale#
MyModifiers2=Fill Color #BackgroundColor# | StrokeWidth 0 | Stroke Color 0,0,0,0 | Scale #Scale#, #Scale#
DynamicVariables=1
LeftMouseUpAction=[!CommandMeasure "MeasureProgress" "SetPosition $MouseX:%$"]

[MeterPlayPause]
Meter=Image
ImageName=[MeasurePlayerState]
X=(232*#Scale#)
Y=(389*#Scale#)
W=(36*#Scale#)
H=(36*#Scale#)
LeftMouseDownAction=[!CommandMeasure "MeasurePlayer" "PlayPause"]
DynamicVariables=1

[MeterPrevious]
Meter=Image
ImageName=#@#Images\Previous.png
X=(195*#Scale#)
Y=(400*#Scale#)
W=(22*#Scale#)
H=(13*#Scale#)
LeftMouseUpAction=[!CommandMeasure "MeasurePlayer" "Previous"]

[MeterNext]
Meter=Image
ImageName=#@#Images\Next.png
X=(283*#Scale#)
Y=(400*#Scale#)
W=(22*#Scale#)
H=(13*#Scale#)
LeftMouseUpAction=[!CommandMeasure "MeasurePlayer" "Next"]

[MeterShuffle]
Meter=Image
ImageName=[MeasurePlayerShuffle]
X=(273*#Scale#)
Y=(458*#Scale#)
W=(19*#Scale#)
H=(15*#Scale#)
LeftMouseDownAction=[!CommandMeasure "MeasurePlayer" "SetShuffle -1"]
DynamicVariables=1

[MeterRepeat]
Meter=Image
ImageName=[MeasurePlayerRepeat]
X=(240*#Scale#)
Y=(458*#Scale#)
W=(19*#Scale#)
H=(15*#Scale#)
LeftMouseDownAction=[!CommandMeasure "MeasurePlayer" "SetRepeat -1"]
DynamicVariables=1

[MeterSettingsMenu]
Meter=Image
ImageName=#@#Images\SettingsMenu.png
X=(207*#Scale#)
Y=(458*#Scale#)
W=(19*#Scale#)
H=(14*#Scale#)
LeftMouseUpAction=[!ToggleConfig "TM - Circlir Mini Player\@Resources" "Settings.ini"]
User avatar
Aethaerx
Posts: 8
Joined: March 24th, 2021, 9:48 pm

Re: How do I format this to scale?

Post by Aethaerx »

Did I add it correctly?

MyModifiers1=Fill Color #BarColor# | StrokeWidth 0 | Stroke Color 0,0,0,0 | Scale #Scale#, #Scale#
MyModifiers2=Fill Color #BackgroundColor# | StrokeWidth 0 | Stroke Color 0,0,0,0 | Scale #Scale#, #Scale#
User avatar
balala
Rainmeter Sage
Posts: 12807
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How do I format this to scale?

Post by balala »

Aethaerx wrote: March 27th, 2021, 8:04 pm Did I add it correctly?
Yes, you did. But unfortunately something else is wrong there, and I couldn't figure out what. I'm working on it, but maybe someone else will take a look and will see something me don't.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 4304
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: How do I format this to scale?

Post by eclectic-tech »

Aethaerx wrote: March 27th, 2021, 8:04 pm Did I add it correctly?

MyModifiers1=Fill Color #BarColor# | StrokeWidth 0 | Stroke Color 0,0,0,0 | Scale #Scale#, #Scale#
MyModifiers2=Fill Color #BackgroundColor# | StrokeWidth 0 | Stroke Color 0,0,0,0 | Scale #Scale#, #Scale#
Add the #Scale# to the defined parameters of the shape, rather than adding the Shape 'Scale'.

Replace the [MeterProgressShape] section with the code below.
This should scale the progress bar properly for you.

Code: Select all

[MeterProgressShape]
Meter=Shape
X=(12*#Scale#)
Y=(288*#Scale#)
Shape=Rectangle 0,0,(#Width#*#Scale#),(#Height#*#Scale#),((#Height#*#Scale#)/2) | Extend MyModifiers2
Shape2=Rectangle 0,0,((#Width#*([MeasureProgress]-[MeasureProgress:MinValue]*(([MeasureProgress:MaxValue]-[MeasureProgress:MinValue]-[MeasureProgress])/([MeasureProgress:MaxValue]-[MeasureProgress:MinValue])))/([MeasureProgress:MaxValue]-[MeasureProgress:MinValue]))*#Scale#),(#Height#*#Scale#),((#Height#*#Scale#)/2) | Extend MyModifiers1
MyModifiers1=Fill Color #BarColor# | StrokeWidth 0 | Stroke Color 0,0,0,0
; | Scale #Scale#, #Scale#
MyModifiers2=Fill Color #BackgroundColor# | StrokeWidth 0 | Stroke Color 0,0,0,0
; | Scale #Scale#, #Scale#
DynamicVariables=1
LeftMouseUpAction=[!CommandMeasure "MeasureProgress" "SetPosition $MouseX:%$"]

I added the scaling to the #Width# and #Height# values in the Rectangle parameters and removed the shape scale values.