It is currently May 11th, 2024, 3:23 am

Help with fader in ActionTimer!

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

Re: Help with fader in ActionTimer!

Post by balala »

andersonventura wrote: December 13th, 2018, 8:56 pm Is there any way to use this method working with shapes?
I'm glad if you find it useful.
Post the code you have so far, please. It definitely is possible, just let's see your code.
User avatar
andersonventura
Posts: 57
Joined: December 11th, 2018, 7:38 pm
Location: Brasil

Re: Help with fader in ActionTimer!

Post by andersonventura »

balala wrote: December 13th, 2018, 9:05 pm I'm glad if you find it useful.
Post the code you have so far, please. It definitely is possible, just let's see your code.

Code: Select all

[Rainmeter]
Update=1
SkinWidth=1920
SkinHeight=1080

;======================================================================

[Variables]
;------------------------------------------
0001=Ellipse 15,15,14 | Fill Color 255,255,255,1 | StrokeWidth 0
0002=Ellipse 15,15,14 | Fill Color 255,255,0,255 | StrokeWidth 0
;------------------------------------------
0003=Ellipse 45,15,14 | Fill Color 255,255,255,1 | StrokeWidth 0
0004=Ellipse 45,15,14 | Fill Color 255,255,0,255 | StrokeWidth 0
;------------------------------------------

;======================================================================

[Slice0001]
Meter=Shape
Shape=#0001#
MouseOverAction=[!SetOption Slice0001 Shape "#0002#"][!UpdateMeter Slice0001][!Redraw]
MouseLeaveAction=[!SetOption Slice0001 Shape "#0001#"][!UpdateMeter Slice0001][!Redraw]

[Slice0002]
Meter=Shape
Shape=#0003#
MouseOverAction=[!SetOption Slice0002 Shape "#0004#"][!UpdateMeter Slice0002][!Redraw]
MouseLeaveAction=[!SetOption Slice0002 Shape "#0003#"][!UpdateMeter Slice0002][!Redraw]
this code was as close as I could get to my goal!
User avatar
balala
Rainmeter Sage
Posts: 16207
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with fader in ActionTimer!

Post by balala »

andersonventura wrote: December 13th, 2018, 9:21 pm this code was as close as I could get to my goal!
Ok, I'll take a look tomorrow. Unfortunately for you, here is almost midnight, so I immediately will go to sleep, but tomorrow I'll try to find a solution (if no one will, in meantime).
User avatar
andersonventura
Posts: 57
Joined: December 11th, 2018, 7:38 pm
Location: Brasil

Re: Help with fader in ActionTimer!

Post by andersonventura »

balala wrote: December 13th, 2018, 9:28 pm Ok, I'll take a look tomorrow. Unfortunately for you, here is almost midnight, so I immediately will go to sleep, but tomorrow I'll try to find a solution (if no one will, in meantime).
Thanks!!!!!!!
User avatar
balala
Rainmeter Sage
Posts: 16207
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with fader in ActionTimer!

Post by balala »

The basic idea is to replace the transparency of each color code with [MeasureAlpha1] or [MeasureAlpha2], accordingly. For example replace the 0001 variable with 0001=Ellipse 15,15,14 | Fill Color 255,255,255,[MeasureAlpha1] | StrokeWidth 0. Also replace the other variables, too. I'm not sure there won't be something which won't work well, but hope the best.
As I said, tomorrow will post a more complex solution.
User avatar
balala
Rainmeter Sage
Posts: 16207
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with fader in ActionTimer!

Post by balala »

Apologies for the very late reply. :oops:

Practically you don't need to change the Shape options of those Shape meters. One shape per meter is enough. You have to change the transparency of the existing shape. For this you have to modify the 0001 and 0003 variables and can remove 0002 and 0004.
Note that the lowest possible value of Update is 16 (second paragraph here). Update=1 can't be used, or in fact Rainmeter will use the lowest Update=16 possible. I put Update=30, but you can experiment to find a better value if needed (without going below 16).
The rewritten code:

Code: Select all

[Rainmeter]
Update=30
SkinWidth=1920
SkinHeight=1080

;======================================================================

[Variables]
;------------------------------------------
0001=Ellipse 15,15,14 | Fill Color 255,255,255,[MeasureAlpha1] | StrokeWidth 0
0002=Ellipse 15,15,14 | Fill Color 255,255,0,255 | StrokeWidth 0
;------------------------------------------
0003=Ellipse 45,15,14 | Fill Color 255,255,255,[MeasureAlpha2] | StrokeWidth 0
0004=Ellipse 45,15,14 | Fill Color 255,255,0,255 | StrokeWidth 0
;------------------------------------------
Sgn1=1
Sgn2=1

;======================================================================

[MeasureAlpha1]
Measure=Calc
Formula=( Clamp (( MeasureAlpha1 + #Sgn1# * 10 ), 1, 255 ))
IfCondition=((#CURRENTSECTION#=1)||(#CURRENTSECTION#=255))
IfTrueAction=[!PauseMeasure "#CURRENTSECTION#"]
DynamicVariables=1
Paused=1

[MeasureAlpha2]
Measure=Calc
Formula=( Clamp (( MeasureAlpha2 + #Sgn2# * 10 ), 1, 255 ))
IfCondition=((#CURRENTSECTION#=1)||(#CURRENTSECTION#=255))
IfTrueAction=[!PauseMeasure "#CURRENTSECTION#"]
DynamicVariables=1
Paused=1

[Slice0001]
Meter=Shape
Shape=#0001#
MouseOverAction=[!SetVariable Sgn1 "1"][!UnpauseMeasure "MeasureAlpha1"]
MouseLeaveAction=[!SetVariable Sgn1 "-1"][!UnpauseMeasure "MeasureAlpha1"]
DynamicVariables=1

[Slice0002]
Meter=Shape
Shape=#0003#
MouseOverAction=[!SetVariable Sgn2 "1"][!UnpauseMeasure "MeasureAlpha2"]
MouseLeaveAction=[!SetVariable Sgn2 "-1"][!UnpauseMeasure "MeasureAlpha2"]
DynamicVariables=1
User avatar
andersonventura
Posts: 57
Joined: December 11th, 2018, 7:38 pm
Location: Brasil

Re: Help with fader in ActionTimer!

Post by andersonventura »

balala wrote: December 15th, 2018, 5:47 pm Apologies for the very late reply. :oops:

Practically you don't need to change the Shape options of those Shape meters. One shape per meter is enough. You have to change the transparency of the existing shape. For this you have to modify the 0001 and 0003 variables and can remove 0002 and 0004.
Note that the lowest possible value of Update is 16 (second paragraph here). Update=1 can't be used, or in fact Rainmeter will use the lowest Update=16 possible. I put Update=30, but you can experiment to find a better value if needed (without going below 16).
The rewritten code:

Code: Select all

[Rainmeter]
Update=30
SkinWidth=1920
SkinHeight=1080

;======================================================================

[Variables]
;------------------------------------------
0001=Ellipse 15,15,14 | Fill Color 255,255,255,[MeasureAlpha1] | StrokeWidth 0
0002=Ellipse 15,15,14 | Fill Color 255,255,0,255 | StrokeWidth 0
;------------------------------------------
0003=Ellipse 45,15,14 | Fill Color 255,255,255,[MeasureAlpha2] | StrokeWidth 0
0004=Ellipse 45,15,14 | Fill Color 255,255,0,255 | StrokeWidth 0
;------------------------------------------
Sgn1=1
Sgn2=1

;======================================================================

[MeasureAlpha1]
Measure=Calc
Formula=( Clamp (( MeasureAlpha1 + #Sgn1# * 10 ), 1, 255 ))
IfCondition=((#CURRENTSECTION#=1)||(#CURRENTSECTION#=255))
IfTrueAction=[!PauseMeasure "#CURRENTSECTION#"]
DynamicVariables=1
Paused=1

[MeasureAlpha2]
Measure=Calc
Formula=( Clamp (( MeasureAlpha2 + #Sgn2# * 10 ), 1, 255 ))
IfCondition=((#CURRENTSECTION#=1)||(#CURRENTSECTION#=255))
IfTrueAction=[!PauseMeasure "#CURRENTSECTION#"]
DynamicVariables=1
Paused=1

[Slice0001]
Meter=Shape
Shape=#0001#
MouseOverAction=[!SetVariable Sgn1 "1"][!UnpauseMeasure "MeasureAlpha1"]
MouseLeaveAction=[!SetVariable Sgn1 "-1"][!UnpauseMeasure "MeasureAlpha1"]
DynamicVariables=1

[Slice0002]
Meter=Shape
Shape=#0003#
MouseOverAction=[!SetVariable Sgn2 "1"][!UnpauseMeasure "MeasureAlpha2"]
MouseLeaveAction=[!SetVariable Sgn2 "-1"][!UnpauseMeasure "MeasureAlpha2"]
DynamicVariables=1
Hello!
Thanks for your help!
I can not make it work here ...
Nothing happens on mouseover. It seems to me that for some reason [MeasureAlpha1] on [Variables] is not being called. When I set a numeric value in place, it shows the shape! Am I missing something?
User avatar
andersonventura
Posts: 57
Joined: December 11th, 2018, 7:38 pm
Location: Brasil

Re: Help with fader in ActionTimer!

Post by andersonventura »

Analyzing again, I realized that just ImageAlpha = (Clamp ([Measure0001], 1,255)) contained in measure, is not inserted! Would not that be the problem?
User avatar
balala
Rainmeter Sage
Posts: 16207
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help with fader in ActionTimer!

Post by balala »

andersonventura wrote: December 16th, 2018, 1:27 am Analyzing again, I realized that just ImageAlpha = (Clamp ([Measure0001], 1,255)) contained in measure, is not inserted! Would not that be the problem?
To be honest I have no idea where have you get the above ImageAlpha option, in my code nowhere a [Measure0001] measure doesn't exist and due to this, you can't use it. In fact a Shape meter doesn't even has an ImageAlpha option, this option can be used only on Image meter. A such option was used in the previous code, but because the last one works with Shape meters instead of Image, it is not used any more. Are you sure you didn't mix something?
But you're right, there something indeed is missing: add a SolidColor=0,0,0,1 option to both Shape meters ([Slice0001] and [Slice0002]).
User avatar
andersonventura
Posts: 57
Joined: December 11th, 2018, 7:38 pm
Location: Brasil

Re: Help with fader in ActionTimer!

Post by andersonventura »

Finally, with your help, balala, I got to what I was looking for! I can not thank you enough for your commitment to a stranger! I hope the world will double you all this help! Thank you!!!

Code: Select all

[Rainmeter]
Update=16
SkinWidth=1920
SkinHeight=1080

[Variables]
MaxAlpha=150

Velocity0001=12
Velocity0002=12

Variable0001=1
Variable0002=1

Shape0001=Ellipse 15,15,14 | Fill Color 255,255,250,[Measure0001] | StrokeWidth 0
Shape0002=Ellipse 45,15,14 | Fill Color 255,255,250,[Measure0002] | StrokeWidth 0

;-------------------------------------------

[Measure0001]
Measure=Calc
Formula=(Clamp((#CURRENTSECTION# + #Variable0001# * #Velocity0001#), 1, #MaxAlpha#))
IfCondition=((#CURRENTSECTION#=1)||(#CURRENTSECTION#=#MaxAlpha#))
IfTrueAction=[!PauseMeasure "#CURRENTSECTION#"]
DynamicVariables=1
Paused=1

[Measure0002]
Measure=Calc
Formula=(Clamp((#CURRENTSECTION# + #Variable0002# * #Velocity0002#), 1, #MaxAlpha#))
IfCondition=((#CURRENTSECTION#=1)||(#CURRENTSECTION#=#MaxAlpha#))
IfTrueAction=[!PauseMeasure "#CURRENTSECTION#"]
DynamicVariables=1
Paused=1

;-------------------------------------------

[Slice0001]
Meter=Shape
Shape=#Shape0001#
SolidColor=0,0,0,1
MouseOverAction=[!SetVariable Velocity0001 "12"][!SetVariable Variable0001 "1"][!UnpauseMeasure "Measure0001"]
MouseLeaveAction=[!SetVariable Velocity0001 "2"][!SetVariable Variable0001 "-1"][!UnpauseMeasure "Measure0001"]
DynamicVariables=1

[Slice0002]
Meter=Shape
Shape=#Shape0002#
SolidColor=0,0,0,1
MouseOverAction=[!SetVariable Velocity0002 "12"][!SetVariable Variable0002 "1"][!UnpauseMeasure "Measure0002"]
MouseLeaveAction=[!SetVariable Velocity0002 "2"][!SetVariable Variable0002 "-1"][!UnpauseMeasure "Measure0002"]
DynamicVariables=1