It is currently March 28th, 2024, 8:08 pm

[SOLVED] MouseLeaveAction not working with Honeycomb? (Fade-in and out)

Get help with creating, editing & fixing problems with skins
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: MouseLeaveAction not working with Honeycomb? (Nice images!)

Post by fonpaolo »

Maybe you can reverse the situation, add an ImageAlpha=50 to your icon images.
In this way, they're always almost transparent, then, hovering your mouse, they'll become fully opaque.
eggy
Posts: 14
Joined: February 24th, 2017, 7:17 pm

Re: MouseLeaveAction not working with Honeycomb? (Nice images!)

Post by eggy »

fonpaolo wrote:Maybe you can reverse the situation, add an ImageAlpha=50 to your icon images.
In this way, they're always almost transparent, then, hovering your mouse, they'll become fully opaque.
I am quite a big noob, how would this work? : o
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: MouseLeaveAction not working with Honeycomb? (Nice images!)

Post by balala »

fonpaolo wrote:Maybe you can reverse the situation, add an ImageAlpha=50 to your icon images.
In this way, they're always almost transparent, then, hovering your mouse, they'll become fully opaque.
This won't work if we want to set the transparency of the skin, with the !SetTransparency bang. If you set the ImageAlpha option of the image meter, you have to modify this option using a !SetVariable or a !SetOption bang, not a !SetTransparency.
eggy wrote:I am quite a big noob, how would this work? : o
Here is a short method to use a fade effect, using the ActionTimer plugin:

Code: Select all

[Rainmeter]
Update=1000
Group=folder
MouseOverAction=[!CommandMeasure MeasureSlide "Stop 2"][!CommandMeasure MeasureSlide "Execute 1"]
MouseLeaveAction=[!CommandMeasure MeasureSlide "Stop 1"][!CommandMeasure MeasureSlide "Execute 2"]

[Variables]
Alpha=255
U=[!UpdateMeasure "MeasureSlide"][!UpdateMeter "folder"][!Redraw]

[MeasureSlide]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat FadeIn,20,25
FadeIn=[!SetVariable Alpha "(Clamp(#Alpha#+10,1,255))"]#U#
ActionList2=Repeat FadeOut,20,25
FadeOut=[!SetVariable Alpha "(Clamp(#Alpha#-10,1,255))"]#U#
DynamicVariables=1

[folder]
Meter=Image
ImageName=#@#Images\folder.png
H=90
LeftMouseUpAction=["folder.exe"]
ImageAlpha=#Alpha#
DynamicVariables=1
In the first moment, the value of the Alpha variable is 255. This will determine the opacity of the image. 255 means fully opaque.
When you're hovering the mouse over the skin, the FadeIn option of the [MeasureSlide] measure will be executed, which should increase the value of the Alpha variable. But it won't, because its value is already 255, which is the maximum possible.
But when you're leaving the skin, the FadeOut option will be executed, decreasing the value of the variable and implicitly fading out the image. When you1re hovering again the mouse over the skin, the variable will be increased and the image will fade in (and so on).
The important thing here is to set the value of the Alpha variable and with this to fade in and out the image.
eggy
Posts: 14
Joined: February 24th, 2017, 7:17 pm

Re: MouseLeaveAction not working with Honeycomb? (Nice images!)

Post by eggy »

balala wrote:This won't work if we want to set the transparency of the skin, with the !SetTransparency bang. If you set the ImageAlpha option of the image meter, you have to modify this option using a !SetVariable or a !SetOption bang, not a !SetTransparency.

Here is a short method to use a fade effect, using the ActionTimer plugin:

Code: Select all

[Rainmeter]
Update=1000
Group=folder
MouseOverAction=[!CommandMeasure MeasureSlide "Stop 2"][!CommandMeasure MeasureSlide "Execute 1"]
MouseLeaveAction=[!CommandMeasure MeasureSlide "Stop 1"][!CommandMeasure MeasureSlide "Execute 2"]

[Variables]
Alpha=255
U=[!UpdateMeasure "MeasureSlide"][!UpdateMeter "folder"][!Redraw]

[MeasureSlide]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat FadeIn,20,25
FadeIn=[!SetVariable Alpha "(Clamp(#Alpha#+10,1,255))"]#U#
ActionList2=Repeat FadeOut,20,25
FadeOut=[!SetVariable Alpha "(Clamp(#Alpha#-10,1,255))"]#U#
DynamicVariables=1

[folder]
Meter=Image
ImageName=#@#Images\folder.png
H=90
LeftMouseUpAction=["folder.exe"]
ImageAlpha=#Alpha#
DynamicVariables=1
In the first moment, the value of the Alpha variable is 255. This will determine the opacity of the image. 255 means fully opaque.
When you're hovering the mouse over the skin, the FadeIn option of the [MeasureSlide] measure will be executed, which should increase the value of the Alpha variable. But it won't, because its value is already 255, which is the maximum possible.
But when you're leaving the skin, the FadeOut option will be executed, decreasing the value of the variable and implicitly fading out the image. When you1re hovering again the mouse over the skin, the variable will be increased and the image will fade in (and so on).
The important thing here is to set the value of the Alpha variable and with this to fade in and out the image.

Wow! It works thanks a lot! Is it possible to set an alpha minimum that it doesnt go below X?
Also is there a way for it to be faded at the begining? For example alpha of 50. Would just need to know the action to activate: "something"=[!SetTransparency "50"]
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: MouseLeaveAction not working with Honeycomb? (Nice images!)

Post by balala »

eggy wrote:Is it possible to set an alpha minimum that it doesnt go below X?
Yeah, it is. The 1 and 255 (the second and third parameter of the Clamp function) in the FadeIn and FadeOut options of the [MeasureSlide] measure are the limits of the transparency. Just replace them with the desired values and the transparency won't exceed these limits.
eggy wrote:Also is there a way for it to be faded at the begining? For example alpha of 50. Would just need to know the action to activate: "something"=[!SetTransparency "50"]
Just replace the value of the Alpha variable, in the [Variables] section: Alpha=50.

And one more: you can set the speed of the fade effect. To do this, replace the first numeric values in the ActionList1 and ActionList2 options of the [MeasureSlide] measure (in my example 20). These values represents the wait time (in milliseconds) between two consecutive updates of the Alpha variable. If you reduce them, the effect will speed up, if you increase them, the effect will slow down.
eggy
Posts: 14
Joined: February 24th, 2017, 7:17 pm

Re: MouseLeaveAction not working with Honeycomb? (Nice images!)

Post by eggy »

balala wrote:Yeah, it is. The 1 and 255 (the second and third parameter of the Clamp function) in the FadeIn and FadeOut options of the [MeasureSlide] measure are the limits of the transparency. Just replace them with the desired values and the transparency won't exceed these limits.

Just replace the value of the Alpha variable, in the [Variables] section: Alpha=50.

And one more: you can set the speed of the fade effect. To do this, replace the first numeric values in the ActionList1 and ActionList2 options of the [MeasureSlide] measure (in my example 20). These values represents the wait time (in milliseconds) between two consecutive updates of the Alpha variable. If you reduce them, the effect will speed up, if you increase them, the effect will slow down.

Amazing, thank you so much for all your help! :D!
eggy
Posts: 14
Joined: February 24th, 2017, 7:17 pm

Re: MouseLeaveAction not working with Honeycomb? (Nice images!)

Post by eggy »

balala wrote:This won't work if we want to set the transparency of the skin, with the !SetTransparency bang. If you set the ImageAlpha option of the image meter, you have to modify this option using a !SetVariable or a !SetOption bang, not a !SetTransparency.

Here is a short method to use a fade effect, using the ActionTimer plugin:

Code: Select all

[Rainmeter]
Update=1000
Group=folder
MouseOverAction=[!CommandMeasure MeasureSlide "Stop 2"][!CommandMeasure MeasureSlide "Execute 1"]
MouseLeaveAction=[!CommandMeasure MeasureSlide "Stop 1"][!CommandMeasure MeasureSlide "Execute 2"]

[Variables]
Alpha=255
U=[!UpdateMeasure "MeasureSlide"][!UpdateMeter "folder"][!Redraw]

[MeasureSlide]
Measure=Plugin
Plugin=ActionTimer
Group=Sliders
ActionList1=Repeat FadeIn,20,25
FadeIn=[!SetVariable Alpha "(Clamp(#Alpha#+10,1,255))"]#U#
ActionList2=Repeat FadeOut,20,25
FadeOut=[!SetVariable Alpha "(Clamp(#Alpha#-10,1,255))"]#U#
DynamicVariables=1

[folder]
Meter=Image
ImageName=#@#Images\folder.png
H=90
LeftMouseUpAction=["folder.exe"]
ImageAlpha=#Alpha#
DynamicVariables=1
In the first moment, the value of the Alpha variable is 255. This will determine the opacity of the image. 255 means fully opaque.
When you're hovering the mouse over the skin, the FadeIn option of the [MeasureSlide] measure will be executed, which should increase the value of the Alpha variable. But it won't, because its value is already 255, which is the maximum possible.
But when you're leaving the skin, the FadeOut option will be executed, decreasing the value of the variable and implicitly fading out the image. When you1re hovering again the mouse over the skin, the variable will be increased and the image will fade in (and so on).
The important thing here is to set the value of the Alpha variable and with this to fade in and out the image.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [SOLVED] MouseLeaveAction not working with Honeycomb? (Fade-in and out)

Post by balala »

Glad to help.
eggy
Posts: 14
Joined: February 24th, 2017, 7:17 pm

Re: [SOLVED] MouseLeaveAction not working with Honeycomb? (Fade-in and out)

Post by eggy »

balala wrote:Glad to help.
:D It looks neat, huh?
https://i.gyazo.com/95629b89dd70a0b250381cd8b69f5035.mp4
eggy
Posts: 14
Joined: February 24th, 2017, 7:17 pm

Re: [SOLVED] MouseLeaveAction not working with Honeycomb? (Fade-in and out)

Post by eggy »

Almost done ^^

Image