It is currently April 28th, 2024, 5:36 pm

Thread for help with the Shape meter

Get help with creating, editing & fixing problems with skins
User avatar
Slim08
Posts: 23
Joined: October 8th, 2018, 4:38 pm

Re: Thread for help with the new Shape meter

Post by Slim08 »

balala wrote:See the Shape3 option, which combines the previous two shapes.
The width of the created shape is 200 pixels (the third number in the Rectangle parameter) and its height is 160 pixels (the sum of the second and fourth number of the Rectangle parameter of Shape2 option. I used arbitrary color for stroke.
You have to modify the parameters, to meet your needs. Feel free to ask, if anything isn't clear enough.
Thx a lot man - on point answer :D
User avatar
balala
Rainmeter Sage
Posts: 16184
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Thread for help with the new Shape meter

Post by balala »

You're welcome.
User avatar
brax64
Posts: 172
Joined: July 8th, 2018, 8:05 pm

Re: Thread for help with the new Shape meter

Post by brax64 »

Slim08 wrote:Hi, I'm new here and didn't want to open a new topic just because of this.
I already feel pretty stupid for asking but how do I get a shape of a rectangle with just the top corners rounded but the bottom ones still square? My best guess is subtracting one shape from the other with the one that is subtracted having Fill Color 0,0,0,0. I tried finding it on https://docs.rainmeter.net/manual/meters/shape/ or someone who did some skin similar but everything i tried was made with images instead of a shape. Can you pleas point me in the right direction?
It can be done also with the shape type "Path", see https://docs.rainmeter.net/manual/meters/shape/#Path
User avatar
balala
Rainmeter Sage
Posts: 16184
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Thread for help with the new Shape meter

Post by balala »

brax64 wrote:It can be done also with the shape type "Path",
Yes, as usually here also are more solutions to the same question. But an example would be great to indicate what have you thought about. So, for example:

Code: Select all

[MeterShape]
Meter=Shape
X=1
Y=1
Shape=Path MyPath | StrokeWidth 2 | Stroke Color 46,215,31 | Fill Color 0,0,0,0
MyPath=0,160 | LineTo 0,10 | ArcTo 10,0,10 | LineTo 190,0 | ArcTo 200,10,10 | LineTo 200,160 | ClosePath 1
User avatar
Slim08
Posts: 23
Joined: October 8th, 2018, 4:38 pm

Re: Thread for help with the new Shape meter

Post by Slim08 »

I ended up with this

Code: Select all

[Rainmeter]
Author=Slim08
AppVersion=v1.0
Update=-1

[Variables]
barwidth=1200

[FrostedGlass]
Measure=Plugin
Plugin=FrostedGlass
Type=Blur
Border=None

[MeterShape]
Meter=Shape
X=0
Y=0
Shape=Rectangle 0,0,#barwidth#,30,7 | Extend MyModifiers1
Shape2=Rectangle 0,10,#barwidth#,30 | Extend MyModifiers1
Shape3=Combine Shape | Union Shape2
Shape4=Rectangle 0,38,#barwidth#,2,0 | Extend MyModifiers2
MyModifiers1=Fill Color 208,209,210,80 | StrokeWidth 0
MyModifiers2=Fill Color 0,0,0,80 | StrokeWidth 0
and I'm very pleased with the result - thx again balala

now I'm looking for a way to make the skin auto center on my screen.
I have 3 monitors which have a total resolution of 6400x1080. 1=secondary screen 1920x1080 | 2=primary screen 2560x1080 | 3=secondary screen 1920x1080. The goal would be to auto center it on screen 2. The catch is that I'm trying to make the centering around the "barwidth" parameter which is subject to changes. Do you guys have any idea how I could do that?
User avatar
balala
Rainmeter Sage
Posts: 16184
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Thread for help with the new Shape meter

Post by balala »

Slim08 wrote:now I'm looking for a way to make the skin auto center on my screen.
Add to your code the following two Calc measures:

Code: Select all

[MeasureX]
Measure=Calc
Formula=(( #SCREENAREAWIDTH# - #CURRENTCONFIGWIDTH# ) / 2 )
DynamicVariables=1

[MeasureY]
Measure=Calc
Formula=(( #SCREENAREAHEIGHT# - #CURRENTCONFIGHEIGHT# ) / 2 )
DynamicVariables=1
Then add the following OnRefReshaction option to the [Rainmeter] section: OnRefreshAction=[!Move "[MeasureX]" "[MeasureY]"].
I hope this will work. I have one single monitor, so can't test it, but I'm hoping it works.

Additionally two other, not very important observations. These definitely don't prevent the skin to work, but have to tell you that:
  • The Author option doesn't belong to the [Rainmeter] section anymore, but to [Metadata]. Yes, once it belonged to [Rainmeter], but not any more.
  • The AppVersion option is completely deprecated. Shouldn't have to be used.
User avatar
Slim08
Posts: 23
Joined: October 8th, 2018, 4:38 pm

Re: Thread for help with the new Shape meter

Post by Slim08 »

I made a mistake - what I meant to say was auto center on the x axis and on the bottom of the screen on the y axis. My bad. This one is working like intended:

Code: Select all

[Rainmeter]
OnRefreshAction=[!Move "[MeasureX]" "[MeasureY]"]
Update=-1

[Metadata]
Author=Slim08

[Variables]
barwidth=1200

[FrostedGlass]
Measure=Plugin
Plugin=FrostedGlass
Type=Blur
Border=None

[MeterShape]
Meter=Shape
X=0
Y=0
Shape=Rectangle 0,0,#barwidth#,30,7 | Extend MyModifiers1
Shape2=Rectangle 0,10,#barwidth#,30 | Extend MyModifiers1
Shape3=Combine Shape | Union Shape2
Shape4=Rectangle 0,38,#barwidth#,2,0 | Extend MyModifiers2
MyModifiers1=Fill Color 208,209,210,80 | StrokeWidth 0
MyModifiers2=Fill Color 0,0,0,80 | StrokeWidth 0

[MeasureX]
Measure=Calc
Formula=(( #SCREENAREAWIDTH# - #CURRENTCONFIGWIDTH# + 640 ) / 2 )
DynamicVariables=1

[MeasureY]
Measure=Calc
Formula=( #SCREENAREAHEIGHT# - #CURRENTCONFIGHEIGHT# )
DynamicVariables=1
thx again balala :welcome:
User avatar
balala
Rainmeter Sage
Posts: 16184
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Thread for help with the new Shape meter

Post by balala »

A question: if you want to center the skin on the X axis (so horizontally), why have you added 640 to the difference, in the Formula option of the [MeasureX] measure?

And a comment: in Formula option of the [MeasureY] measure, instead of #SCREENAREAHEIGHT#, I probably would better use #WORKAREAHEIGHT# (Formula=( #SCREENAREAHEIGHT# - #CURRENTCONFIGHEIGHT# )). If you're working with #SCREENAREAHEIGHT# and the taskbar is in the bottom of the screen, it can hide the skin. But if you're using #WORKAREAHEIGHT#, the skin doesn't go below the taskbar, remaining visible.
User avatar
Slim08
Posts: 23
Joined: October 8th, 2018, 4:38 pm

Re: Thread for help with the new Shape meter

Post by Slim08 »

That's funny
And a comment: in Formula option of the [MeasureY] measure, instead of #SCREENAREAHEIGHT#, I probably would better use #WORKAREAHEIGHT# (Formula=( #SCREENAREAHEIGHT# - #CURRENTCONFIGHEIGHT# )). If you're working with #SCREENAREAHEIGHT# and the taskbar is in the bottom of the screen, it can hide the skin. But if you're using #WORKAREAHEIGHT#, the skin doesn't go below the taskbar, remaining visible.
because I want it to go behind the taskbar (mine is transparent and the skin is like a custom one / replacement)
A question: if you want to center the skin on the X axis (so horizontally), why have you added 640 to the difference, in the Formula option of the [MeasureX] measure?
I don't know if it is a bug or I just don't get the logic behind rainmeters calculation but it seems like rainmeter is thinking for some reason that my center screen (2560x1080) is the same resolution then the other two side screens (both 1920x1080). The skin was always a bit off to the left side when I tried your original code til i figured out that it was exactly off by 640 (difference between 2560 and 1920) :D
User avatar
balala
Rainmeter Sage
Posts: 16184
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Thread for help with the new Shape meter

Post by balala »

Slim08 wrote:because I want it to go behind the taskbar (mine is transparent and the skin is like a custom one / replacement)
In this case it's ok with #SCREENAREAHEIGHT#, I think.
Slim08 wrote:I don't know if it is a bug or I just don't get the logic behind rainmeters calculation but it seems like rainmeter is thinking for some reason that my center screen (2560x1080) is the same resolution then the other two side screens (both 1920x1080). The skin was always a bit off to the left side when I tried your original code til i figured out that it was exactly off by 640 (difference between 2560 and 1920) :D
Ok, now I understood. Can't add anything smart here, because as I said, I'm using one single monitor, so I don't know what's going on if you have more.