It is currently March 28th, 2024, 3:12 pm

group fade don't know how ..

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

Re: group fade don't know how ..

Post by balala »

The script does look complicated enough, but my question would be why do you need a lua script for fading in/out a meter/group? A such task can be definitely simpler managed by the ActionTimer plugin. And in plus, it wouldn't require a such small update value, as your code does. This would be a big advantage, in my opinion.
So, are you absolutely positively you need that lua script?
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: group fade don't know how ..

Post by balala »

dvo wrote:this lua fade i can set manual other one is a auto fade set on one fade setting :D
i'm playing with some scripts altering but trying out lua have to learn it some how ... :D
and the lua has more things in it like move x and move y but for now i only need to know how to adress the group function
alone i can adress it already but combined is better for a mouse over with text :)
Even with the ActionTimer plugin, if you're knowing it personally, you have a lot of settings possibilities.
Anyway for my part, as I said, the lua script does look complicated enough to doesn't worth to alter it. Sorry.
If you're interested into the ActionTimer plugin approach, let me (us) know.
dvo wrote:b.t.w. my pc has enough power to use update=16 :D
I don't contest this, but if is possible a greater Update is better, even on powerful machines (my opinion). Especially if you have a lot of skins loaded (as I have).
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: group fade don't know how ..

Post by jsmorley »

Using ActionTimer to do a fade is not terribly hard, and far, far easier and more efficient than a Lua script and Update=16.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
BackgroundMode=2
SolidColor=0,0,0,1
MouseOverAction=[!CommandMeasure MeasureFadeOut "Stop 1"][!CommandMeasure MeasureFadeIn "Execute 1"]
MouseLeaveAction=[!CommandMeasure MeasureFadeIn "Stop 1"][!CommandMeasure MeasureFadeOut "Execute 1"]

[Variables]
W=2
U=[!UpdateMeasureGroup Faders][!UpdateMeterGroup Faders][!Redraw]
CurrentAlpha=160

[MeasureFadeOut]
Measure=Plugin
Plugin=ActionTimer
Group=Faders
ActionList1=Repeat FadeCalc,#W#,20
FadeCalc=[!SetVariable CurrentAlpha "(Clamp(#CurrentAlpha#-5,160,255))"]#U#
DynamicVariables=1

[MeasureFadeIn]
Measure=Plugin
Plugin=ActionTimer
Group=Faders
ActionList1=Repeat FadeCalc,#W#,20
FadeCalc=[!SetVariable CurrentAlpha "(Clamp(#CurrentAlpha#+5,160,255))"]#U#
DynamicVariables=1

[MeterImage]
Meter=Image
Group=Faders
W=150
H=100
SolidColor=65,163,209,#CurrentAlpha#
DynamicVariables=1

[MeterText]
Meter=String
Group=Faders
Y=15R
X=75
StringAlign=Center
FontSize=20
FontColor=255,255,255,#CurrentAlpha#
Padding=5,5,5,5
SolidColor=0,0,0,#CurrentAlpha#
AntiAlias=1
Text=Hello World
DynamicVariables=1
gif.gif
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: group fade don't know how ..

Post by jsmorley »

A bit of code yes, but mostly just a bunch of variables and one pretty hefty ActionTimer measure...

Code: Select all

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

[Variables]
W=5
U=[!UpdateMeasure MeasureFader][!UpdateMeterGroup Faders][!Redraw]
CurrentAlphaOne=160
CurrentAlphaTwo=160
CurrentAlphaThree=160
CurrentAlphaFour=160
CurrentAlphaFive=160

[MeasureFader]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat Fade1,#W#,20
Fade1=[!SetVariable CurrentAlphaOne "(Clamp(#CurrentAlphaOne#-5,160,255))"]#U#
ActionList2=Repeat Fade2,#W#,20
Fade2=[!SetVariable CurrentAlphaOne "(Clamp(#CurrentAlphaOne#+5,160,255))"]#U#
ActionList3=Repeat Fade3,#W#,20
Fade3=[!SetVariable CurrentAlphaTwo "(Clamp(#CurrentAlphaTwo#-5,160,255))"]#U#
ActionList4=Repeat Fade4,#W#,20
Fade4=[!SetVariable CurrentAlphaTwo "(Clamp(#CurrentAlphaTWo#+5,160,255))"]#U#
ActionList5=Repeat Fade5,#W#,20
Fade5=[!SetVariable CurrentAlphaThree "(Clamp(#CurrentAlphaThree#-5,160,255))"]#U#
ActionList6=Repeat Fade6,#W#,20
Fade6=[!SetVariable CurrentAlphaThree "(Clamp(#CurrentAlphaThree#+5,160,255))"]#U#
ActionList7=Repeat Fade7,#W#,20
Fade7=[!SetVariable CurrentAlphaFour "(Clamp(#CurrentAlphaFour#-5,160,255))"]#U#
ActionList8=Repeat Fade8,#W#,20
Fade8=[!SetVariable CurrentAlphaFour "(Clamp(#CurrentAlphaFour#+5,160,255))"]#U#
ActionList9=Repeat Fade9,#W#,20
Fade9=[!SetVariable CurrentAlphaFive "(Clamp(#CurrentAlphaFive#-5,160,255))"]#U#
ActionList10=Repeat Fade10,#W#,20
Fade10=[!SetVariable CurrentAlphaFive "(Clamp(#CurrentAlphaFive#+5,160,255))"]#U#
DynamicVariables=1

[TextStyle]
Group=Faders
Y=5R
W=120
FontSize=13
FontWeight=700
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
DynamicVariables=1

[MeterOne]
Meter=String
MeterStyle=TextStyle
Y=0
FontColor=255,255,255,#CurrentAlphaOne#
Text=Meter One
MouseOverAction=[!CommandMeasure MeasureFader "Stop 1"][!CommandMeasure MeasureFader "Execute 2"]
MouseLeaveAction=[!CommandMeasure MeasureFader "Stop 2"][!CommandMeasure MeasureFader "Execute 1"]

[MeterTwo]
Meter=String
MeterStyle=TextStyle
FontColor=255,255,255,#CurrentAlphaTwo#
Text=Meter Two
MouseOverAction=[!CommandMeasure MeasureFader "Stop 3"][!CommandMeasure MeasureFader "Execute 4"]
MouseLeaveAction=[!CommandMeasure MeasureFader "Stop 4"][!CommandMeasure MeasureFader "Execute 3"]

[MeterThree]
Meter=String
MeterStyle=TextStyle
FontColor=255,255,255,#CurrentAlphaThree#
Text=Meter Three
MouseOverAction=[!CommandMeasure MeasureFader "Stop 5"][!CommandMeasure MeasureFader "Execute 6"]
MouseLeaveAction=[!CommandMeasure MeasureFader "Stop 6"][!CommandMeasure MeasureFader "Execute 5"]

[MeterFour]
Meter=String
MeterStyle=TextStyle
FontColor=255,255,255,#CurrentAlphaFour#
Text=Meter Four
MouseOverAction=[!CommandMeasure MeasureFader "Stop 7"][!CommandMeasure MeasureFader "Execute 8"]
MouseLeaveAction=[!CommandMeasure MeasureFader "Stop 8"][!CommandMeasure MeasureFader "Execute 7"]

[MeterFive]
Meter=String
MeterStyle=TextStyle
FontColor=255,255,255,#CurrentAlphaFive#
Text=Meter Five
MouseOverAction=[!CommandMeasure MeasureFader "Stop 9"][!CommandMeasure MeasureFader "Execute 10"]
MouseLeaveAction=[!CommandMeasure MeasureFader "Stop 10"][!CommandMeasure MeasureFader "Execute 9"]
gif.gif
One note: I noticed that with this skin, if I set the value of the "wait", the variable #W#, much less than "5", it ran the risk of overwhelming the Rainmeter message queue and sometimes even hanging Rainmeter if I ran the cursor over all all those meters really quickly up and down. Leave enough time between each individual action, so things don't get too stacked up. I found that 5 milliseconds worked pretty well for this skin.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: group fade don't know how ..

Post by jsmorley »

dvo wrote:this one i did with the lua ... incl. image works well to. less code :D :o
i prefer the lua it's a better way handy less code instead of action timer couse you have to
set every action timer again and again .. the lua just does this with less code ... makes your code better readable ;-)
[Rainmeter]
Update=16
LeftMouseUpAction=!Refresh

[Variables]
b1=button1
b2=button2
b3=button3
b4=button4
b5=button5

[Transition]
Measure=Script
ScriptFile=Transition.lua


[sMeter]
Meter=String
FontColor=255,255,255,255
FontSize=10
StringStyle=Bold
AntiAlias=1
UpdateDivider=#UpdateMultiplier#
DynamicVariables=1

[iMeter]
ImageAlpha=70
X=100r
Y=100
H=100
W=100

[Line1]
Meter=Image
ImageName="aufguss.jpg"
ImageAlpha=70
Meterstyle=iMeter
MouseOverAction=[!ShowMeter Line1, Line1T][!CommandMeasure Transition "FadeIn('Line1')"][!CommandMeasure Transition "FadeIn('Line1T')"]
MouseLeaveAction=[!ShowMeter Line1][!CommandMeasure Transition "FadeOut('Line1T')"][!ShowMeter Line1T][!CommandMeasure Transition "FadeOut('Line1')"]
LeftMouseUpAction=

[Line1T]
Meter=string
Meterstyle=sMeter
X=r
Y=100
H=30
W=100
Text=#b1#
FontColor=ffffff70

[Line2]
Meter=Image
ImageName="aufguss.jpg"
ImageAlpha=70
Meterstyle=iMeter
MouseOverAction=[!ShowMeter Line2, Line2T][!CommandMeasure Transition "FadeIn('Line2')"][!CommandMeasure Transition "FadeIn('Line2T')"]
MouseLeaveAction=[!ShowMeter Line2,Line2T][!CommandMeasure Transition "FadeOut('Line2')"][!CommandMeasure Transition "FadeOut('Line2T')"]
LeftMouseUpAction=

[Line2T]
Meter=string
Meterstyle=sMeter
X=r
Y=100
H=30
W=100
Text=#b2#
FontColor=ffffff70

[Line3]
Meter=Image
ImageName="aufguss.jpg"
ImageAlpha=70
Meterstyle=iMeter
MouseOverAction=[!ShowMeter Line3, Line3T][!CommandMeasure Transition "FadeIn('Line3')"][!CommandMeasure Transition "FadeIn('Line3T')"]
MouseLeaveAction=[!ShowMeter Line3,Line3T][!CommandMeasure Transition "FadeOut('Line3')"][!CommandMeasure Transition "FadeOut('Line3T')"]
LeftMouseUpAction=

[Line3T]
Meter=string
Meterstyle=sMeter
X=r
Y=100
H=30
W=100
Text=#b3#
FontColor=ffffff70

[Line4]
Meter=Image
ImageName="aufguss.jpg"
ImageAlpha=70
Meterstyle=iMeter
MouseOverAction=[!ShowMeter Line4, Line4T][!CommandMeasure Transition "FadeIn('Line4')"][!CommandMeasure Transition "FadeIn('Line4T')"]
MouseLeaveAction=[!ShowMeter Line4,Line4T][!CommandMeasure Transition "FadeOut('Line4')"][!CommandMeasure Transition "FadeOut('Line4T')"]
LeftMouseUpAction=

[Line4T]
Meter=string
Meterstyle=sMeter
X=r
Y=100
H=30
W=100
Text=#b4#
FontColor=ffffff70

[Line5]
Meter=Image
ImageName="aufguss.jpg"
ImageAlpha=70
Meterstyle=iMeter
MouseOverAction=[!ShowMeter Line5, Line5T][!CommandMeasure Transition "FadeIn('Line5')"][!CommandMeasure Transition "FadeIn('Line5T')"]
MouseLeaveAction=[!ShowMeter Line5,Line5T][!CommandMeasure Transition "FadeOut('Line5')"][!CommandMeasure Transition "FadeOut('Line5T')"]
LeftMouseUpAction=

[Line5T]
Meter=string
Meterstyle=sMeter
X=r
Y=100
H=30
W=100
Text=#b5#
FontColor=ffffff70
Fair enough, there is seldom any one "right" way to do things in Rainmeter.
Post Reply