It is currently March 28th, 2024, 10:47 pm

Thread for help with the Shape meter

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Thread for help with the new Shape meter

Post by balala »

prince1142003 wrote:Should've posted that. I'm using 4.1.0 beta r2824 64-bit (Jul 7 2017).
Then not this is the problem.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Thread for help with the new Shape meter

Post by eclectic-tech »

prince1142003 wrote:I'm basically trying to achieve a shadow/glow effect around the circle.

I played with the stroke idea, but the problem is that the stroke is half inside the shape and half outside. If the interior of the shape is semitransparent, and the stroke is also semitransparent, they overlap in the interior region and it doesn't look good.

...

How do I fill the ring shape radially, fading from solid red at 92% to solid black at 100%?
The radial gradient on your ellipse is behaving a bit strange, but by including the optional settings for offset and radius at zero levels, it seems to behave as expected. Try this code for the ellipse shapes; I modified the radial gradient definition and extended the 'black' out to 1.25 percent so the 'red' is the dominant color of the radial ring.

Code: Select all

[BackgroundCircle]
Meter=Shape
Shape=Ellipse 100, 50, 46, 46 | Fill LinearGradient LinearGrad | StrokeWidth 0
Shape2=Ellipse 100, 50, 50, 50 | Fill RadialGradient ShadowGrad | StrokeWidth 0
Shape3=Ellipse 100, 50, 46, 46 | Fill Color 0,0,0,0 | StrokeWidth 0
Shape4=Combine Shape2 | Exclude Shape3
LinearGrad=0 | 0,0,255,128 ; 0 | 0,255,0,128 ; 1
ShadowGrad=100, 50, 0, 0, 0, 0 | 0,0,0,0 ; 0.0 | 0,0,0,0 ; 0.91 | 255,0,0,255 ; 0.92 | 0,0,0,64 ; 1.25
DynamicVariables=1
UpdateDivider=-1
Group=PanelBG
You could achieve a similar effect using rounded rectangle shapes:

Code: Select all

[BackgroundCircle]
Meter=Shape
Shape=Rectangle 52, 0, 100, 100, 50 | Fill RadialGradient ShadowGrad | StrokeWidth 0
Shape2=Rectangle 54, 4, 92, 92, 46 | Fill LinearGradient1 LinearGrad | StrokeWidth 0
LinearGrad=0 | 0,0,255,128 ; 0 | 0,255,0,128 ; 1
ShadowGrad=100,50 | 0,0,0,0 ; 0.0 | 0,0,0,0 ; 0.91 | 255,0,0,255 ; 0.92 | 0,0,0,64 ; 1.25
DynamicVariables=1
UpdateDivider=-1
Group=PanelBG
Not sure why adding the optional settings to the radial gradient matter, but they do... a bug?
Hope this helps. :welcome:
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 »

Pretty basic question. I wanna make a line that goes from fully transparent to white and fully transparent again.

Code: Select all

[MeterLine]
Meter=Shape
Shape=Line 50,0,50,420  | StrokeWidth 2 | Fill LinearGradient1 LinearGrad
LinearGrad=0 | 0,0,255,128 ; 0 | 0,255,0,128 ; 1
I'm trying this but I don't think the syntax is correct. I searched in the docs for gradients in the line shape but I didn't find anything.
Also, is it possible to add a gradient in an image meter? If so, what would the syntax be again?

Code: Select all

[MeterLine2]
Meter=Image
SolidColor=255,255,255,200
W=2
H=420
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Thread for help with the new Shape meter

Post by balala »

kyriakos876 wrote:I wanna make a line that goes from fully transparent to white and fully transparent again.
EDIT: Sorry if you've read my reply, I just realized I've misunderstood your question: what you've tried to do, I think is not possible. The gradient aren't related to the stroke, but to the fill color. But a Line shape doesn't has a fill color, just a Stroke color.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Thread for help with the new Shape meter

Post by balala »

But you can simulate something similar: create a Rectangle shape, instead of a Line one, without a Stroke and use the gradient on its Fill Color option:

Code: Select all

[MeterLine]
Meter=Shape
Shape=Rectangle 50,0,2,420  | StrokeWidth 0 | Fill LinearGradient LinearGrad
LinearGrad=90 | 0,0,255,128 ; 0 | 0,255,0,128 ; 1
I've replaced the first value of the LinearGrad option with 90, because with 0 (as you had it) on the 2 pixels wide "line" (rectangle) shape, the gradient wouldn't be properly visible.
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 »

balala wrote:But you can simulate something similar: create a Rectangle shape, instead of a Line one, without a Stroke and use the gradient on its Fill Color option:

Code: Select all

[MeterLine]
Meter=Shape
Shape=Rectangle 50,0,2,420  | StrokeWidth 0 | Fill LinearGradient LinearGrad
LinearGrad=90 | 0,0,255,128 ; 0 | 0,255,0,128 ; 1
I've replaced the first value of the LinearGrad option with 90, because with 0 (as you had it) on the 2 pixels wide "line" (rectangle) shape, the gradient wouldn't be properly visible.
Never read your answer so I don't know what you said, but this is correct :D Thanks.
Final code:

Code: Select all

[MeterLine]
Meter=Shape
Shape=Rectangle 50,0,2,420  | StrokeWidth 0 | Fill LinearGradient LinearGrad
LinearGrad=90 | 255,255,255,0 ; 0 | 255,255,255,255 ; 0.5 | 255,255,255,0 ; 1
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Thread for help with the new Shape meter

Post by balala »

kyriakos876 wrote:Never read your answer
That's good, because as I said, initially I've strongly misunderstood your request. I'm glad if it's working well.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Thread for help with the new Shape meter

Post by eclectic-tech »

balala wrote:EDIT: Sorry if you've read my reply, I just realized I've misunderstood your question: what you've tried to do, I think is not possible. The gradient aren't related to the stroke, but to the fill color. But a Line shape doesn't has a fill color, just a Stroke color.
@ balala
I think you overlooked that the Stroke parameter in any shape CAN use a defined gradient as the stroke parameter.
Here is code for what kyriakos876 requested.

Code: Select all

[MeterShapeLine]
Meter=Shape
X=0
Y=0
MyGrad=90 | 0,0,0,1 ; 0.0 | 255,255,255,255 ; 0.5 | 0,0,0,1 ; 1.0
; Shape=Line StartX, StartY, EndX, EndY
Shape=Line 50,0,50,420  | StrokeWidth 2 | Stroke LinearGradient MyGrad
Generates a line with a gradient stroke:
strokegrad1.png
Sorry for the 2 month delayed reply... 'tis the busy season :)
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Thread for help with the new Shape meter

Post by balala »

eclectic-tech wrote:@ balala
I think you overlooked that the Stroke parameter in any shape CAN use a defined gradient as the stroke parameter.
Yeah, you're right (again!). I didn't think to this possibility.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Thread for help with the new Shape meter

Post by eclectic-tech »

balala wrote:Yeah, you're right (again!). I didn't think to this possibility.
It is easy to understand how this could be overlooked... the Shape meter is, by far, the most complicated and powerful meter in Rainmeter.

I am still discovering new possibilities a year after it's introduction. :D