It is currently August 9th, 2020, 8:03 am

Thread for help with the Shape meter

Help with creating, editing & fixing problems with skins
User avatar
jsmorley
Developer
Posts: 21225
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Thread for help with the new Shape meter

Post by jsmorley »

kyriakos876 wrote:Yea I did the double arc as well but I felt stupid having to draw 2 arcs, one for the stroke and one for the fill... What's next? drawing a circle pixel by pixel? Anyway... That whole open shape sounds weird to me to begin with but whatever. I ended up drawing the thing in Photoshop and using the image.
Vector graphics (Illustrator / Inkscape) has a lot of strengths over Raster graphics (Photoshop / Gimp), in that you can dynamically change it, size it, color it and all that, which you can't do with raster, but it's not for everyone. Drawing is a different mindset than painting.
User avatar
jsmorley
Developer
Posts: 21225
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Thread for help with the new Shape meter

Post by jsmorley »

As I said, this can be done with a single Path shape as well.

Code: Select all

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

[Variables]
Green=0,255,0,255
Yellow=255,255,0,255
Red=255,0,0,255

[Example]
Meter=Shape
X=100
Y=100
Shape=Path MyPath | Fill LinearGradient MyGradient | StrokeWidth 1
MyPath=0,0 | ArcTo 100,0 | SetNoStroke 1 | LineTo 0,0 | ClosePath 1
MyGradient=180 | #Green# ; 0.0 | #Yellow# ; 0.7 | #Red# ; 1.0
1.png
Or:

Code: Select all

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

[Variables]
Green=0,255,0,255
Yellow=255,255,0,255
Red=255,0,0,255

[Example]
Meter=Shape
X=100
Y=100
Shape=Path MyPath | Fill LinearGradient MyGradient | StrokeWidth 1
MyPath=0,0 | ArcTo 100,0 | SetNoStroke 1 | LineTo 0,0 | ClosePath 1
MyGradient=180 | #Green# ; 0.0 | #Green# ; 0.55 | #Yellow# ; 0.7 | #Yellow# ; 0.75 | #Red# ; 0.9 | #Red# ; 1.0
3.png
Or:

Code: Select all

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

[Variables]
Green=0,255,0,255
Yellow=255,255,0,255
Red=255,0,0,255

[Example]
Meter=Shape
X=100
Y=100
Shape=Path MyPath | Fill LinearGradient MyGradient | StrokeWidth 1
MyPath=0,0 | ArcTo 100,0 | SetNoStroke 1 | LineTo 0,0 | ClosePath 1
MyGradient=180 | #Green# ; 0.0 | #Green# ; 0.7 | #Yellow# ; 0.7 | #Yellow# ; 0.8 | #Red# ; 0.8 | #Red# ; 1.0
2.png
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 11181
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Thread for help with the new Shape meter

Post by balala »

jsmorley wrote:

Code: Select all

[Example]
Meter=Shape
X=100
Y=100
Shape=Arc -50,0,50,0,40,40,0,0,0,1 | Fill LinearGradient MyGradient | Stroke Color 0,0,0,0
MyGradient=180 | 52,168,83 ; 0.5 | 234,67,53 ; 1.0
Shape2=Arc -50,0,50,0,40,40,0,0,0,0
Yes, very good. I tried a bit differently, with no succes at all. My approach was not to close the arc, but to combine two shapes, one open arc and a line, which would close the arc. The line should have be not visible (its color should have to be 0,0,0,0 and / or its StrokWidth should have to be also 0). But the arc not being closed, the gradient can't be applied nor in this case:

Code: Select all

[Example]
Meter=Shape
X=100
Y=100
Shape=Arc -50,0,50,0,40,40,0,0,0,0 | Fill LinearGradient MyGradient
Shape2=Line 50,0,-50,0 | Extend MyModifiers
MyGradient=180 | 52,168,83 ; 0.5 | 234,67,53 ; 1.0 
MyModifiers=StrokeWidth 0 | Stroke Color 0,0,0,0
Didn't think about your solution, which indeed work all right. :thumbup:
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Thread for help with the new Shape meter

Post by kyriakos876 »

Yea, I'll stick to my image until I find a final form for it, as modifying in photoshop is easier. After I find the final form maybe I'll do it with path to avoid having images in my skin. Thanks for the alternatives though!
User avatar
jsmorley
Developer
Posts: 21225
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Thread for help with the new Shape meter

Post by jsmorley »

balala wrote:Yes, very good. I tried a bit differently, with no succes at all. My approach was not to close the arc, but to combine two shapes, one open arc and a line, which would close the arc. The line should have be not visible (its color should have to be 0,0,0,0 and / or its StrokWidth should have to be also 0). But the arc not being closed, the gradient can't be applied nor in this case:

Code: Select all

[Example]
Meter=Shape
X=100
Y=100
Shape=Arc -50,0,50,0,40,40,0,0,0,0 | Fill LinearGradient MyGradient
Shape2=Line 50,0,-50,0 | Extend MyModifiers
MyGradient=180 | 52,168,83 ; 0.5 | 234,67,53 ; 1.0 
MyModifiers=StrokeWidth 0 | Stroke Color 0,0,0,0
Didn't think about your solution, which indeed work all right. :thumbup:
Two separate shapes can be combined and that does (and must) create a "closed" shape, but then they share the "parent" shape's modifiers. If you set a StrokeWidth or Stroke Color on the "parent", then any "child" shapes you combine with it will have that StrokeWidth and Stroke Color. Using Combine in this case can't work, as you have conflicting needs. You want a stroke on the "parent", but not on the "child", Combining shapes creates a new, single shape, which doesn't have separate "segments" that can be treated differently. For that, you need the Path shape where you can turn on or off the stroke, or two distinct shapes, where you can have entirely different modifiers.
User avatar
balala
Rainmeter Sage
Posts: 11181
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Thread for help with the new Shape meter

Post by balala »

jsmorley wrote:Two separate shapes can be combined and that does (and must) create a "closed" shape, but then they share the "parent" shape's modifiers. If you set a StrokeWidth or Stroke Color on the "parent", then any "child" shapes you combine with it will have that StrokeWidth and Stroke Color. Using Combine in this case can't work, as you have conflicting needs. You want a stroke on the "parent", but not on the "child", Combining shapes creates a new, single shape, which doesn't have separate "segments" that can be treated differently. For that, you need the Path shape where you can turn on or off the stroke, or two distinct shapes, where you can have entirely different modifiers.
Thanks for these details. Again learned something new. It seems I still didn't got used to this new meter type...
User avatar
Brian
Developer
Posts: 2044
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Thread for help with the new Shape meter

Post by Brian »

This has been fixed for the next beta. Thanks for reporting!

-Brian
User avatar
jsmorley
Developer
Posts: 21225
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Thread for help with the new Shape meter

Post by jsmorley »

Brian wrote:This has been fixed for the next beta. Thanks for reporting!

-Brian
What has been fixed is that it is now consistent that both Fill Color and Fill LinearGradient / RadialGradient will work on an "open" shape.

This will work as expected when we release the next beta:

Code: Select all

[Example]
Meter=Shape
X=100
Y=100
Shape=Arc -50,0,50,0,40,40,0,0,0,0 | Fill LinearGradient MyGradient
MyGradient=180 | 52,168,83 ; 0.5 | 234,67,53 ; 1.0
1.png
You do not have the required permissions to view the files attached to this post.
User avatar
Slim08
Posts: 23
Joined: October 8th, 2018, 4:38 pm

Re: Thread for help with the new Shape meter

Post by Slim08 »

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?
User avatar
balala
Rainmeter Sage
Posts: 11181
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Thread for help with the new Shape meter

Post by balala »

Slim08 wrote:I already fell 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?
Why are you feel stupid? For a beginner, every question can create problems. This forum is a place where you can ask this type of questions.
So, I'd combine two shapes, one rounded and the other not. Here is a sample code:

Code: Select all

[MeterShape]
Meter=Shape
X=20
Y=20
Shape=Rectangle 0,0,200,100,20 | Extend MyModifiers1
Shape2=Rectangle 0,60,200,100 | Extend MyModifiers1
Shape3=Combine Shape | Union Shape2
MyModifiers1=Fill Color 0,0,0,0 | StrokeWidth 2 | Stroke Color 46,215,31
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.