It is currently March 28th, 2024, 8:59 am

New Shape Meter

Changes made during the Rainmeter 4.0 beta cycle.
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy
Contact:

Re: New Shape Meter

Post by fonpaolo »

Never mind, thanks jsmorley anyway, I found a solution.

I've to admit that I'm starting to love this Shape meter, but, shh... don't tell anyone. ;-) :sly:

In the meantime, experimenting with it, if it were possible, I would suggest adding a new type of attribute modifier, or a sort of, since I think a "Pattern" is missing.

Something similar to: take a shape, line or path, then repeat it n times spacing it with two parameters for the distance from top (and bottom) and from left (and right).

Code: Select all

Shape5=Rectangle 0,0,12,12 | Fill Color 150,150,150,200
Shape6=Rectangle 0,0,220,300 | Pattern myPattern
myPattern=Shape5 | 120 | 5,5
...or I'm probably too lazy to repeat a thing n times. :lol:
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: New Shape Meter

Post by jsmorley »

The Shape meter is really pretty cool.


test1.gif
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy
Contact:

Re: New Shape Meter

Post by fonpaolo »

Yes, it's pretty cool. :thumbup:

I don't know if my above suggestion could be considered or not, however I've found a workaround to create a pattern, I'll have to experiment a little.
User avatar
Yincognito
Rainmeter Sage
Posts: 7017
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: New Shape Meter

Post by Yincognito »

jsmorley wrote: April 21st, 2020, 11:28 pm The Shape meter is really pretty cool.



test1.gif
So I suppose these "cylinders" are closed stroke paths (made of two vertical lines and two arcs at the top and bottom, and filled with gradients) combined with the inversely filled stroked ellipses at the top, right? With the animation made by dynamically changing the length of the vertical lines?

Just curious, since they indeed look so nice... 8-)
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: New Shape Meter

Post by jsmorley »

Yincognito wrote: April 22nd, 2020, 12:18 pm So I suppose these "cylinders" are closed stroke paths (made of two vertical lines and two arcs at the top and bottom, and filled with gradients) combined with the inversely filled stroked ellipses at the top, right? With the animation made by dynamically changing the length of the vertical lines?

Just curious, since they indeed look so nice... 8-)

Code: Select all

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

[Variables]
DarkBlue=65,138,217,255
LightBlue=220,234,250,255
DarkGreen=70,217,65,255
LightGreen=221,250,220,255
DarkGold=217,197,65,255
LightGold=250,248,220
DarkRed=217,65,65,255
LightRed=250,220,220,255

[MeasureLoop]
Measure=Loop
StartValue=0
EndValue=52
IfCondition=MeasureLoop = 52
IfTrueAction=[!SetOption MeasureLoop InvertMeasure "1"][!UpdateMeasure MeasureLoop]
IfCondition2=MeasureLoop = 0
IfTrueAction2=[!SetOption MeasureLoop InvertMeasure "0"][!UpdateMeasure MeasureLoop]

[MeterCylinder1]
Meter=Shape
X=10
Y=10
Shape=Rectangle 0,0,50,200,25,10 | StrokeWidth 2 | Fill LinearGradient MyGradient1
Shape2=Rectangle 0,0,50,20,25,10 | StrokeWidth 2 | Fill LinearGradient MyGradient2
MyGradient1=360 | #DarkBlue# ; 0.0 | #LightBlue# ; 1.0
MyGradient2=180 | #DarkBlue# ; 0.0 | #LightBlue# ; 1.0

[MeterCylinder2]
Meter=Shape
X=20R
Y=10
Shape=Rectangle 0,(50-[MeasureLoop]),50,(150+[MeasureLoop]),25,10 | StrokeWidth 2 | Fill LinearGradient MyGradient1
Shape2=Rectangle 0,(50-[MeasureLoop]),50,20,25,10 | StrokeWidth 2 | Fill LinearGradient MyGradient2
MyGradient1=360 | #DarkGreen# ; 0.0 | #LightGreen# ; 1.0
MyGradient2=180 | #DarkGreen# ; 0.0 | #LightGreen# ; 1.0
DynamicVariables=1

[MeterCylinder3]
Meter=Shape
X=20R
Y=10
Shape=Rectangle 0,(100-[MeasureLoop]),50,(100+[MeasureLoop]),25,10 | StrokeWidth 2 | Fill LinearGradient MyGradient1
Shape2=Rectangle 0,(100-[MeasureLoop]),50,20,25,10 | StrokeWidth 2 | Fill LinearGradient MyGradient2
MyGradient1=360 | #DarkGold# ; 0.0 | #LightGold# ; 1.0
MyGradient2=180 | #DarkGold# ; 0.0 | #LightGold# ; 1.0
DynamicVariables=1

[MeterCylinder4]
Meter=Shape
X=20R
Y=10
Shape=Rectangle 0,(150-[MeasureLoop]),50,(50+[MeasureLoop]),25,10 | StrokeWidth 2 | Fill LinearGradient MyGradient1
Shape2=Rectangle 0,(150-[MeasureLoop]),50,20,25,10 | StrokeWidth 2 | Fill LinearGradient MyGradient2
MyGradient1=360 | #DarkRed# ; 0.0 | #LightRed# ; 1.0
MyGradient2=180 | #DarkRed# ; 0.0 | #LightRed# ; 1.0
DynamicVariables=1
But yes, it could be done with LineTo and ArcTo.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: New Shape Meter

Post by jsmorley »

Code: Select all

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

[Variables]
ScaleFactor=1.0

[MeasureRotate]
Measure=Loop
StartValue=0
EndValue=359
Increment=3

[MeterSunAndEarth]
Meter=Shape
W=(152 * #ScaleFactor#)
H=(152 * #ScaleFactor#)
X=(52 * #ScaleFactor#)
Y=(52 * #ScaleFactor#)
Shape=Ellipse 50,50,50 | StrokeWidth 0 | Fill RadialGradient SunGrad
SunGrad=0,0 | 252,239,151,255 ; 0.0 | 171,43,43,255 ; 1.5
Shape2=Ellipse 110,110,15 | StrokeWidth 0 | Fill RadialGradient EarthGrad | Rotate [MeasureRotate], -45, -45
EarthGrad=0,0,-20,-20,30,30 | 200,226,250,255 ; 0.0 | 36,93,145,255 ; 1.0
DynamicVariables=1
TransformationMatrix=#ScaleFactor#;0;0;#ScaleFactor#;0;0

; Rotate degree, (CenterBigX - CenterSmallX + CenterSmallRadiusX), (CenterBigY - CenterSmallY + CenterSmallRadiusY)
; 50 - 110 + 15" = -45

; Remember that TransformmationMatrix does not change the size of the meter, and so DynamicWindowSize won't be effective when you scale up a shape meter with TransformationMatrix. You need to dynamically set the meter size large enough, so DynamicWindowSize can enlarge the overall skin as needed.

test1.gif
User avatar
Yincognito
Rainmeter Sage
Posts: 7017
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: New Shape Meter

Post by Yincognito »

jsmorley wrote: April 22nd, 2020, 12:25 pmBut yes, it could be done with LineTo and ArcTo.
True, but your way is much more elegant and easier. The other demo is nice too. ;-)
Couldn't reply to you sooner, as the site is quite slow for a couple of days now (and got tired to wait for it to load). Just thought you should know.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: New Shape Meter

Post by jsmorley »

Yincognito wrote: April 22nd, 2020, 2:48 pm True, but your way is much more elegant and easier. The other demo is nice too. ;-)
Couldn't reply to you sooner, as the site is quite slow for a couple of days now (and got tired to wait for it to load). Just thought you should know.
Seems better today. It was slow indeed yesterday.
User avatar
Yincognito
Rainmeter Sage
Posts: 7017
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: New Shape Meter

Post by Yincognito »

jsmorley wrote: April 22nd, 2020, 2:52 pm Seems better today. It was slow indeed yesterday.
Understood.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: New Shape Meter

Post by jsmorley »

fonpaolo wrote: April 22nd, 2020, 11:39 am I don't know if my above suggestion could be considered or not, however I've found a workaround to create a pattern, I'll have to experiment a little.
I doubt that we would add things that are not part of the normal behavior of the standard vector graphics engine. We are trying to stick pretty close to it, to facilitate using Tools like Inkscape to at least prototype your shape meters, and to keep it as simple as possible, given the relative complexity of vector graphics in general.

I'm not opposed in principle to things that reduce repetitive code, we get those kind of requests all the time. Given our limited resources though, we have to prioritize what we work on.
Post Reply