It is currently April 16th, 2024, 11:42 pm

[SOLVED] Mouse On Hover [Fade In / Out Transition]

Get help with creating, editing & fixing problems with skins
Tappaz
Posts: 2
Joined: March 21st, 2019, 6:41 am

[SOLVED] Mouse On Hover [Fade In / Out Transition]

Post by Tappaz »

Sorry for wasting anyone's time. Apparently I don't know how to proof read code before using it. I fixed [!UpdateMeter "folder"][!Redraw] to reflect the tag for my icon. Working as intended now. /facepalm
Hi all,

Relatively new to all this but have been dabbling and wanted to spice up my desktop. I dug through previous posts and found what I was after but cant tweak it to how I want it to function.

Currently I'm trying to transition Honeycomb desktop icons with a fade in and out (see code below). It works, however the transition is very jarring and not smooth. I have the Alpha transparency set so it wont go past a certain limit. So it looks faded into the wallpaper and on hover it will bring it back to its solid / opaque state.

As you can see in the video the transition is not smooth and doesn't gradually fade in / out but rather will jump to the next value set.

What do I need to change so the transition will be much smoother?

Thanks in advance for any pointers and help.

What mine looks like now...

_______________________________________________________________________________________________________________

Code: Select all

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

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

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

[CORSAIR LINK]
Meter=Image
ImageName=#@#Images\corsair.png
H=90
LeftMouseUpAction=["C:\Program Files (x86)\CorsairLink4\CorsairLink4.exe"]
ImageAlpha=#Alpha#
DynamicVariables=1
Original post I sourced code from courtesy from @balala : https://forum.rainmeter.net/viewtopic.php?f=5&t=25284
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5391
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: [SOLVED] Mouse On Hover [Fade In / Out Transition]

Post by eclectic-tech »

To control the speed of the alpha change, modify the "wait" and "repeats" portion of your Repeat action; e.g.; Repeat FadeIn,10,15 OR change the value you add to #alpha# in the actual action from 10 to 5. You would need to adjust the number of repeats to make sure you reach you clamping levels.

I would also recommend modifying the #U# variable; right now it updates the [MeasureSlide] and [folder] sections, but you named your meter [CORSAIR LINK] so your meter is NOT being updated after each action.

U=[!UpdateMeasure "MeasureSlide"][!UpdateMeter *][!Redraw]

Using [!UpdateMeter *][!Redraw] will update very meter in the skin.
Tappaz
Posts: 2
Joined: March 21st, 2019, 6:41 am

Re: [SOLVED] Mouse On Hover [Fade In / Out Transition]

Post by Tappaz »

eclectic-tech wrote: March 21st, 2019, 9:45 am To control the speed of the alpha change, modify the "wait" and "repeats" portion of your Repeat action; e.g.; Repeat FadeIn,10,15 OR change the value you add to #alpha# in the actual action from 10 to 5. You would need to adjust the number of repeats to make sure you reach you clamping levels.

I would also recommend modifying the #U# variable; right now it updates the [MeasureSlide] and [folder] sections, but you named your meter [CORSAIR LINK] so your meter is NOT being updated after each action.

U=[!UpdateMeasure "MeasureSlide"][!UpdateMeter *][!Redraw]

Using [!UpdateMeter *][!Redraw] will update very meter in the skin.
Thanks for the reply eclectic-tech,

Yeah I figured that out once I proofed the code and realized the tags weren't correct. I figured out the transition speed, as even when it didn't work with the smooth transition it would alter the delay so I knew I was on the right track. I'd set the alpha in the variable to 100 that that would be the max and it works well now.

Code: Select all

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

[Variables]
Alpha=100
U=[!UpdateMeasure "MeasureSlide"][!UpdateMeter "CORSAIR LINK"][!Redraw]

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

[CORSAIR LINK]
Meter=Image
ImageName=#@#Images\corsair.png
H=90
LeftMouseUpAction=["C:\Program Files (x86)\CorsairLink4\CorsairLink4.exe"]
ImageAlpha=#Alpha#
DynamicVariables=1
New code in action...


I'm almost certain it probably still needs to be cleaned up but it's working for what I wanted to achieve. If there's some improving I could do please let me know.

Cheers mate :thumbup: