It is currently September 1st, 2024, 2:35 am

Thread for help with the Shape meter

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

Re: Thread for help with the Shape meter

Post by Yincognito »

Jeff wrote: October 19th, 2022, 7:52 pm I just noticed FillColor and Fill Color (with a space) do the same thing, can't find anything about it on the docs, I guess it's just a harmless parsing error that ends up resolving itself
I think I encountered that behavior too, if I remember correctly. I always forget what's the right way to write it, so I just copy paste that bit from the manual and move on... :D
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
DudeGuy11
Posts: 6
Joined: February 20th, 2023, 10:17 pm

Re: Thread for help with the Shape meter

Post by DudeGuy11 »

I just found a Rainmeter skin that had exactly the effect I needed but its the wrong shape. Im trying to turn the effect into a hollow square or rectangle, that would act as a thick-ish border for my screen, now its a full square so im trying to figure out how to modify it. Its the skin created by JSMorley.

Thanks to anybody in advance

Code: Select all

[Rainmeter]
Update=50
DynamicWindowSize=1
AccurateText=1

[Metadata]
Name=ColorRotate
Author=JSMorley
Information=Use Lua to rotate through the "Hue" of the HSB color space. The "saturation" and "brightness" can be set to some desired initial value.
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Version=August 25, 2017

[MeasureMyColor]
Measure=Script
ScriptFile=ColorRotate.lua
; MySaturation and MyBrightness can be 0.0 (none) to 1.0 (full)
MySaturation=0.75
MyBrightness=1.0
DynamicVariables=1

[MeterMyImage]
Meter=Image
Shape=Rectangle 0,0,245,140,20
W=2000
H=2000
SolidColor=[MeasureMyColor]
DynamicVariables=1

[MeterMyString]
Meter=String
X=15R
Y=25
FontSize=1
FontWeight=400
FontColor=[MeasureMyColor]
AntiAlias=1
DynamicVariables=1
Text=Color is: [MeasureMyColor]
User avatar
Yincognito
Rainmeter Sage
Posts: 8003
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Thread for help with the Shape meter

Post by Yincognito »

DudeGuy11 wrote: February 20th, 2023, 10:50 pm I just found a Rainmeter skin that had exactly the effect I needed but its the wrong shape. Im trying to turn the effect into a hollow square or rectangle, that would act as a thick-ish border for my screen, now its a full square so im trying to figure out how to modify it. Its the skin created by JSMorley.
There are a number of ways you can do it, but I guess the easiest one would be to use a stroke colored with the said effect and have the fill color either partially or completely transparent for your rectangle. Something like this, instead of your MeterMyImage:

Code: Select all

[MeterMyThickishBorder]
Meter=Shape
Shape=Rectangle (0+10/2),(0+10/2),(1920-10/2),(1080-10/2) | StrokeWidth 10 | Stroke Color [MeasureMyColor] | Fill Color 0,0,0,0
DynamicVariables=1
You need to add and subtract half of the stroke width when it comes to the rectangle coordinates because the stroke / border is drawn from its middle towards its margin so it should be a bit inwards to avoid clipping parts of it. Also, in the code you posted the meter type was wrong (it's a shape, not an image in this case) and the solid color didn't act on the shape at all, other than providing a general fill for the meter. Of course, you can adjust the dimensions of the rectangle to your liking.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
DudeGuy11
Posts: 6
Joined: February 20th, 2023, 10:17 pm

Re: Thread for help with the Shape meter

Post by DudeGuy11 »

Wow thank you Yincognito , so the parameter that affects the thickness of the border is, strokewidth? And so now I need to adjust width along with shaping it to my screen so ill just tool around with that.
DudeGuy11
Posts: 6
Joined: February 20th, 2023, 10:17 pm

Re: Thread for help with the Shape meter

Post by DudeGuy11 »

A side question, would it be possible to split the frame into 4 pieces and have the color rotation rotating at different points for each piece?

Just a curiosity I had.

Thanks again
User avatar
Yincognito
Rainmeter Sage
Posts: 8003
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Thread for help with the Shape meter

Post by Yincognito »

DudeGuy11 wrote: February 20th, 2023, 11:50 pmWow thank you Yincognito , so the parameter that affects the thickness of the border is, strokewidth?
Yes it is, indeed.

In case you didn't know, if you declare a variable called, let's say, Thickness=10 in the related [Variables] section of the skin (create it at the start of the skin), you could set the coordinates formula based on that, so you wouldn't need to modify every occurrence of the thickness value each time you change it - something like:

Code: Select all

[Variables]
Thickness=10
...
...
...
[MeterMyThickishBorder]
Meter=Shape
Shape=Rectangle (0+#Thickness#/2),(0+#Thickness#/2),(1920-#Thickness#/2),(1080-#Thickness#/2) | StrokeWidth #Thickness# | Stroke Color [MeasureMyColor] | Fill Color 0,0,0,0
DynamicVariables=1
So now the formula stays the same since it references the static #Thickness# variable, and you can play all you want with the value declared at the top, the coordinates below will adjust accordingly. You can approach this similarly in the case of the dimensions or whatever, if you need to.
DudeGuy11 wrote: February 21st, 2023, 12:10 am A side question, would it be possible to split the frame into 4 pieces and have the color rotation rotating at different points for each piece?
Probably. It depends on what you mean by rotating at different points. If it's this skin, I suspect that copy pasting MeasureMyColor under different names and setting various hue and saturation values in each case should do it, assuming you then reference the newly created measures in the Stroke Color parameter of your newly created meters for the rest of the pieces.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
DudeGuy11
Posts: 6
Joined: February 20th, 2023, 10:17 pm

Re: Thread for help with the Shape meter

Post by DudeGuy11 »

Alright, ima take a look at that, thanks again for the very detailed and massively helpful reply.
User avatar
sl23
Posts: 1583
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Thread for help with the Shape meter

Post by sl23 »

I am wondering if it's possible to use an IfCondition to change the X position of a shape meter, but by specifying only one shape within that shape meter?

eg: If a disk isn't available, the meters to the right move to the left so leaving no gaps, or at least a one or two pixels gap.

Code: Select all

Shape=Rectangle                           0, 0, #BarW#, #BarH# | StrokeWidth 0 | Extend Fill1
Shape2=Rectangle   0, 0, #BarW#, ([m1Used:]/[m1Total:]*#BarH#) | StrokeWidth 0 | Extend Fill2
Shape3=Rectangle                         14, 0, #BarW#, #BarH# | StrokeWidth 0 | Extend Fill3
Shape4=Rectangle  14, 0, #BarW#, ([m2Used:]/[m2Total:]*#BarH#) | StrokeWidth 0 | Extend Fill4
Shape5=Rectangle                         28, 0, #BarW#, #BarH# | StrokeWidth 0 | Extend Fill5
Shape6=Rectangle  28, 0, #BarW#, ([m3Used:]/[m3Total:]*#BarH#) | StrokeWidth 0 | Extend Fill6
Shape7=Rectangle                         42, 0, #BarW#, #BarH# | StrokeWidth 0 | Extend Fill7
Shape8=Rectangle  42, 0, #BarW#, ([m4Used:]/[m4Total:]*#BarH#) | StrokeWidth 0 | Extend Fill8
Shape9=Rectangle                         56, 0, #BarW#, #BarH# | StrokeWidth 0 | Extend Fill9
Shape10=Rectangle 56, 0, #BarW#, ([m5Used:]/[m5Total:]*#BarH#) | StrokeWidth 0 | Extend Fill10
Is there a way to Extend the X position the same way you can with FillColor and StrokeWidth/Color?

Thanks :thumbup:
:welcome:
User avatar
sl23
Posts: 1583
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Thread for help with the Shape meter

Post by sl23 »

Found this is the docs:
Offset Default: 0, 0
Offsets (moves) the shape in the X and / or Y axis some number of positive or negative pixels.
Example: Shape=Rectangle 0,0,100,100 | Offset 10,0
Not sure if that works the way I wanted though? Or if it's dynamically changeable?
:welcome:
User avatar
Yincognito
Rainmeter Sage
Posts: 8003
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Thread for help with the Shape meter

Post by Yincognito »

sl23 wrote: July 13th, 2024, 1:20 pm Found this is the docs:

Not sure if that works the way I wanted though? Or if it's dynamically changeable?
Why wouldn't it work dynamically the way you wanted? As long as you have DynamicVariables=1 on the meter, and you use some changed variable as one of the parameter for the Offset part, it should work...

P.S. Didn't think of using the offset to move the "hold" values in the other thread, lol. I just computed the rectangle corners in formulas.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth