It is currently March 28th, 2024, 7:53 pm

Thread for help with the Shape meter

Get help with creating, editing & fixing problems with skins
User avatar
jsmorley
Developer
Posts: 22628
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:Oh yea.... now that you said it that way I got it... I mean... I had it before but now I got it... If that makes sense. I wonder how photoshop and such handle this... Like, do they draw the stroke in the middle and then move it another-half of the stroke? then would that change the shape of the shape? wooosh weird stuff. Anyway that D2D I guess... Again, thanks.
You draw "borders" in Photohop, not "strokes". Photoshop is not a drawing program.
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 »

jsmorley wrote:You draw "borders" in Photohop, not "strokes". Photoshop is not a drawing program.
oh I see. Interesting.
User avatar
brax64
Posts: 172
Joined: July 8th, 2018, 8:05 pm

Re: Thread for help with the new Shape meter

Post by brax64 »

Hi there,
I would like to change the gradient of a shape with MouseOverAction but I can't get it... honestly I'm not even sure that it's possible to do... anyway, here the test code I'm using:

Code: Select all

[Bckgrnd]
Meter=Shape
Shape=Rectangle  0,0,240,245 | Fill Color 0,0,0,1 |StrokeWidth 1 | Stroke Color 0,0,0,1

[Beam];
Meter=Shape
MyGrad=  0 | 170,250,250,255  ; 0.0| 90,170,170,40 ; 1.0 
MyPath=230,65 | LineTo  230,80 | LineTo 125,245 | ClosePath 1 
Shape= Path MyPath | StrokeWidth 1 | Fill LinearGradient MyGrad | Stroke  LinearGradient MyGrad
So I need to change "MyGrad" when the mouse hover the shape.
Thanks in advance for your replies! ;-)
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 »

brax64 wrote:So I need to change "MyGrad" when the mouse hover the shape.
Remove the semicolon from the end of the [Beam] meter name and add the following two options to the [Bckgrnd] meter:

Code: Select all

[Bckgrnd]
...
MouseOverAction=[!SetOption Beam MyGrad "0 | 90,170,170,40 ; 0.0 | 170,250,250,255 ; 1.0"][!UpdateMeter "Beam"][!Redraw]
MouseLeaveAction=[!SetOption Beam MyGrad "0 | 170,250,250,255 ; 0.0 | 90,170,170,40 ; 1.0"][!UpdateMeter "Beam"][!Redraw]
Obviously this is just an example, to see how it can be done. I don't know what you want to achieve, so I posted just a sample code.
Any option of any meter or measure can be changed through !SetOption bangs, this one isn't an exception.
User avatar
brax64
Posts: 172
Joined: July 8th, 2018, 8:05 pm

Re: Thread for help with the new Shape meter

Post by brax64 »

balala wrote:Remove the semicolon from the end of the [Beam] meter name and add the following two options to the [Bckgrnd] meter:

Code: Select all

[Bckgrnd]
...
MouseOverAction=[!SetOption Beam MyGrad "0 | 90,170,170,40 ; 0.0 | 170,250,250,255 ; 1.0"][!UpdateMeter "Beam"][!Redraw]
MouseLeaveAction=[!SetOption Beam MyGrad "0 | 170,250,250,255 ; 0.0 | 90,170,170,40 ; 1.0"][!UpdateMeter "Beam"][!Redraw]
Obviously this is just an example, to see how it can be done. I don't know what you want to achieve, so I posted just a sample code.
Any option of any meter or measure can be changed through !SetOption bangs, this one isn't an exception.
Thanks for your answer balala, still having a little problem with your solution tho; at the first mouse over action the gradient get changed but, on the mouseleave action nothing happen and the gradient doesn't change anymore...
Tried to remove the declaration of MyGrad inside the [Beam] meter, also tried to define the mouse action inside the [beam] meter instead of the [Bckgrnd] but neither one work...
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 »

brax64 wrote:at the first mouse over action the gradient get changed but, on the mouseleave action nothing happen and the gradient doesn't change anymore...
Tried to remove the declaration of MyGrad inside the [Beam] meter, also tried to define the mouse action inside the [beam] meter instead of the [Bckgrnd] but neither one work...
Are you sure? Because it works perfectly for me. Please post the whole code, as you have it right now.
User avatar
brax64
Posts: 172
Joined: July 8th, 2018, 8:05 pm

Re: Thread for help with the new Shape meter

Post by brax64 »

balala wrote:Are you sure? Because it works perfectly for me. Please post the whole code, as you have it right now.

Code: Select all

[Bckgrnd]
Meter=Shape
Shape=Rectangle  0,0,240,250 | Fill Color 0,0,0,1 |StrokeWidth 1 | Stroke Color 0,0,0,1
MouseOverAction=[!SetOption Beam MyGrad "0 | 90,170,170,40 ; 0.0 | 170,250,250,255 ; 1.0"][!UpdateMeter "Beam"][!Redraw]
MouseLeaveAction=[!SetOption Beam MyGrad "180 | 170,250,250,255 ; 0.0 | 90,170,170,40 ; 1.0"][!UpdateMeter "Beam"][!Redraw]
...
...
...
[Beam]
Meter=Shape
MyGrad=  0 | 170,250,250,255  ; 0.0| 90,170,170,40 ; 1.0 
MyPath=230,65 | LineTo  230,80 | LineTo 125,245 | ClosePath 1 
Shape= Path MyPath | StrokeWidth 1 | Fill LinearGradient MyGrad | Stroke  LinearGradient MyGrad

here you go
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 »

It isn't changing back, because there is a mistake in the MouseOverAction / MouseLeaveAction options. When you're hovering the mouse over the skin, the option changes to 0 | 90,170,170,40 ; 0.0 | 170,250,250,255 ; 1.0. When you're leaving it, it changes to 180 | 170,250,250,255 ; 0.0 | 90,170,170,40 ; 1.0. But these two options are the same. In the first one (MouseOverAction) at the beginning (0.0) you have the 90,170,170,40 and at the end (1.0), the 170,250,250,255 color. In the second option (set by the MouseLeaveaction option) you have them vice-versa 170,250,250,255 at the beginning and 90,170,170,40 at the end), but you have between them an angle of 180 degrees. This makes them to be in fact the same gradient.
Try to modify the angle of the second option (MouseLeaveAction), to the same one as the angle of the first one:

Code: Select all

MouseOverAction=[!SetOption Beam MyGrad "0 | 90,170,170,40 ; 0.0 | 170,250,250,255 ; 1.0"][!UpdateMeter "Beam"][!Redraw]
MouseLeaveAction=[!SetOption Beam MyGrad "0 | 170,250,250,255 ; 0.0 | 90,170,170,40 ; 1.0"][!UpdateMeter "Beam"][!Redraw]
The option set by the MouseLeaveAction is now the same as the initial one (set in the meter itself).
User avatar
brax64
Posts: 172
Joined: July 8th, 2018, 8:05 pm

Re: Thread for help with the new Shape meter

Post by brax64 »

balala wrote:It isn't changing back, because there is a mistake in the MouseOverAction / MouseLeaveAction options. When you're hovering the mouse over the skin, the option changes to 0 | 90,170,170,40 ; 0.0 | 170,250,250,255 ; 1.0. When you're leaving it, it changes to 180 | 170,250,250,255 ; 0.0 | 90,170,170,40 ; 1.0. But these two options are the same. In the first one (MouseOverAction) at the beginning (0.0) you have the 90,170,170,40 and at the end (1.0), the 170,250,250,255 color. In the second option (set by the MouseLeaveaction option) you have them vice-versa 170,250,250,255 at the beginning and 90,170,170,40 at the end), but you have between them an angle of 180 degrees. This makes them to be in fact the same gradient.
Try to modify the angle of the second option (MouseLeaveAction), to the same one as the angle of the first one:

Code: Select all

MouseOverAction=[!SetOption Beam MyGrad "0 | 90,170,170,40 ; 0.0 | 170,250,250,255 ; 1.0"][!UpdateMeter "Beam"][!Redraw]
MouseLeaveAction=[!SetOption Beam MyGrad "0 | 170,250,250,255 ; 0.0 | 90,170,170,40 ; 1.0"][!UpdateMeter "Beam"][!Redraw]
The option set by the MouseLeaveAction is now the same as the initial one (set in the meter itself).
Thanks balala, yet again you showed how talented you are! I do need to apologize 'cause I should pay more attention to these details... well I guess/hope that with time and practice I'll get better to catch those silly mistakes...
Again, thank you very much for your time and availability!!!
btw, after that modification everything work as supposed to.. !!
:17good
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 »

brax64 wrote:Thanks balala, yet again you showed how talented you are!
Thanks for the appreciations.
brax64 wrote:I do need to apologize 'cause I should pay more attention to these details...
No, you don't have to. It happens to all of us sometimes, I think.
brax64 wrote:well I guess/hope that with time and practice I'll get better to catch those silly mistakes...
Be sure. You definitely will...
brax64 wrote:btw, after that modification everything work as supposed to.. !!
I'm glad.