It is currently January 22nd, 2022, 5:12 am

Help setting up a timed image pop up

Help with creating, editing & fixing problems with skins
User avatar
Nilvarno
Posts: 54
Joined: March 24th, 2019, 5:52 pm

Re: Help setting up a timed image pop up

Post by Nilvarno »

yes please :)
User avatar
balala
Rainmeter Sage
Posts: 13719
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help setting up a timed image pop up

Post by balala »

Nilvarno wrote: January 12th, 2022, 1:50 pm yes please :)
Ok, here is an example.
First you need two new variables, Alpha1 and Alpha2, which will control the transparency of the two Image meters ([ROTTR] and [FallGuys_client_game]). Add them to the [Variables] section:

Code: Select all

[Variables]
Alpha1=0
Alpha2=0
You also need an ActionTimer plugin measure. Add it as well to your code:

Code: Select all

[MeasureFade]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat FadeIn1,20,20
FadeIn1=[!SetVariable Alpha1 "(Clamp((#Alpha1#+13),0,255))"]#U1#
ActionList2=Repeat FadeOut1,20,20
FadeOut1=[!SetVariable Alpha1 "(Clamp((#Alpha1#-13),0,255))"]#U1#
ActionList3=Repeat FadeIn2,20,20
FadeIn2=[!SetVariable Alpha2 "(Clamp((#Alpha2#+13),0,255))"]#U1#
ActionList4=Repeat FadeOut2,20,20
FadeOut2=[!SetVariable Alpha2 "(Clamp((#Alpha2#-13),0,255))"]#U1#
DynamicVariables=1
As you see this measure uses two more, for now not added variables, U1 and U2. You have to add these too to the [Variables] section, beside the already added Alpha1 and Alpha2. These variables are used to specify what should update the actions executed by the Action Timer plugin:

Code: Select all

[Variables]
...
U1=[!UpdateMeasure "MeasureFade"][!UpdateMeter "ROTTR"][!Redraw]
U2=[!UpdateMeasure "MeasureFade"][!UpdateMeter "FallGuys_client_game"][!Redraw]
The Alpha1 and Alpha2 variables, added to the [Variables] section and set through the above [MeasureFade] measure are used to control the transparency of the two Image meters (as already said). Add the appropriate options to the Image meters:

Code: Select all

[ROTTR]
...
ImageAlpha=#Alpha1#
DynamicVariables=1

...

[FallGuys_client_game]
...
ImageAlpha=#Alpha2#
DynamicVariables=1
And finally you have to modify the IfTrueAction options of the [MeasureProcessTopOne] and [MeasureProcessTopTwo] measures. Note that beside modifying these options, I removed the IfFalseAction options of the same measures:

Code: Select all

[MeasureProcessTopOne]
...
IfCondition=(#CURRENTSECTION#>0)
IfTrueAction=[!CommandMeasure "MeasureFade" "Execute 1"][!CommandMeasure "MeasureFade" "Stop 2"][!Delay "4000"][!CommandMeasure "MeasureFade" "Stop 1"][!CommandMeasure "MeasureFade" "Execute 2"]

...

[MeasureProcessTopOne]
...
IfCondition=(#CURRENTSECTION#>0)
IfTrueAction=[!CommandMeasure "MeasureFade" "Execute 3"][!CommandMeasure "MeasureFade" "Stop 4"][!Delay "4000"][!CommandMeasure "MeasureFade" "Stop 3"][!CommandMeasure "MeasureFade" "Execute 4"]
With this procedure you don't get hidden and shown the Image meters as with the previous procedure (which used the !ShowMeter / !HideMeter bangs), but get them totally transparent (when they should have been hidden) or totally opaque (when they should have been shown). But the result is almost the same (there is however a difference).
Please let me know if you succeeded in getting this to properly work.
User avatar
Nilvarno
Posts: 54
Joined: March 24th, 2019, 5:52 pm

Re: Help setting up a timed image pop up

Post by Nilvarno »

It works very well, the fading animation is not exactly as smooth as the !ShowFade one but it's very close indeed. You gave me a nice tool here, i can use this for other things i was thinking on doing, thank you very much for everything :thumbup: Just one last question, if i may: in your experience, what's heavier for Rainmeter, have lots of skins to load, have less skins but with longer codes or whatever because it's just a trivial load anyway? I have a high cpu and gpu, plus 32gb of Ram, so i know i shouldn't even bother with such a lightweight software, lol, but still...
User avatar
balala
Rainmeter Sage
Posts: 13719
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help setting up a timed image pop up

Post by balala »

Nilvarno wrote: January 12th, 2022, 5:52 pm It works very well, the fading animation is not exactly as smooth as the !ShowFade one but it's very close indeed. You gave me a nice tool here, i can use this for other things i was thinking on doing, thank you very much for everything
Note here something I forgot to mention: in the ActionListX options of the ActionTimer plugin measure you have two values:
  • The first one is the wait time (expressed in milliseconds). The plugin waits this number of milliseconds between two consecutive execution of the action (of the bangs used into the FadeInX / FadeOutX options).
  • The second is the number of repetitions. When executed an action, it is repeated so many times.
In this case both parameters have been set to 20 (yeah, probably was not the best idea when posted a sample code - my bad!). You can play especially with the wait time, to find the value which best matches your needs.
Nilvarno wrote: January 12th, 2022, 5:52 pm Just one last question, if i may: in your experience, what's heavier for Rainmeter, have lots of skins to load, have less skins but with longer codes or whatever because it's just a trivial load anyway? I have a high cpu and gpu, plus 32gb of Ram, so i know i shouldn't even bother with such a lightweight software, lol, but still...
Can't say precisely, probably it depends on many aspects. However with a decent configuration, this shouldn't be a problem for today's computers and OS. And your computer is probably more than decent. So don't worry. But you could get a much more precise advice from a dev. Sorry, but can't say more...
User avatar
Nilvarno
Posts: 54
Joined: March 24th, 2019, 5:52 pm

Re: Help setting up a timed image pop up

Post by Nilvarno »

Thanks, i'm already fiddling with values, i'm pretty much satisfied now :)
User avatar
balala
Rainmeter Sage
Posts: 13719
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Help setting up a timed image pop up

Post by balala »

Nilvarno wrote: January 12th, 2022, 6:57 pm Thanks, i'm already fiddling with values, i'm pretty much satisfied now :)
Great! Have fun...