It is currently March 28th, 2024, 11:05 pm

Please help

Get help with creating, editing & fixing problems with skins
ANN0Y1NGHACKER
Posts: 2
Joined: April 26th, 2018, 7:37 am

Please help

Post by ANN0Y1NGHACKER »

I added the code for the image to change on hover but it changes suddenly and looks really bad. Is there a way to change the image with a fade transition between them?

Code: Select all

[Chrome]
Meter=Image
ImageName=#@#Images\Square\chrome.png
H=68
LeftMouseDoubleClickAction=["C:\Users\*name*\Desktop\Google Chrome"]
MouseOverAction=!Execute [!SetOption #CURRENTSECTION# ImageName "#@#Images\Square\chrome1.png"][!UpdateMeter #CURRENTSECTION#][!Redraw]
MouseLeaveAction=!Execute [!SetOption #CURRENTSECTION# ImageName "#@#Images\Square\chrome.png"][!UpdateMeter #CURRENTSECTION#][!Redraw]

[Rainmeter]
Update=1000

[Metadata]
Name=Chrome
Author=ANN0Y1NGHACEKR
Last edited by ANN0Y1NGHACKER on April 26th, 2018, 12:46 pm, edited 1 time in total.
Image
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: Please help

Post by Mor3bane »

What version of Rainmeter are you using?

The !Execute BANG is depreciated and is no longer required. So that may be something to consider. Just delete that and the !SetOption BANG should do the trick.

However, in my case I like to get my hover icon change like this:

Code: Select all

[BottomImage]
Meter=Image
ImageName=#@#Bottom.png
X=0
Y=0
W=23
H=23
SolidColor=0,0,0,1
DynamicVariables=1

[Mid]
Meter=Image
ImageName=#@#Mid.png
X=0
Y=0
W=23
H=23
MouseLeaveAction=[!HideMeter Mid]
SolidColor=0,0,0,1
DynamicVariables=1

[BottomClick]
Meter=Image
SolidColor=0,0,0,1
X=r
Y=r
W=23
H=23
MouseOverAction=[!ShowMeter Mid]
Things are prioritised according to the top to bottom of your skin code - e.g. the last image in the code will be the "topmost" image, simply covering the earlier images in you code.

Did I say that ok?
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Change Rainmeter Image with fade on hover

Post by balala »

ANN0Y1NGHACKER wrote:I added the code for the image to change on hover but it changes suddenly and looks really bad. Is there a way to change the image with a fade transition between them?
Did you mark accidentally this thread as being solved?
If so, here is a first solution.
First for a such action (to fade out one image and simultaneously fade in another one), you need two different image meters, one with the first image and the second with the second image. The meters must have to be placed in the same location and must have the same size. Initially the first image is visible and the second is transparent and when you're hovering the mouse over it, this is changing: the first will fade out and the second will fade in. Then, when you're leaving the meter, the opposite process will go on: first meter will fade in and the second will fade out.
To make all this, you need a variable. I named it Fade. Its value will vary between 0 (the first meter is completely opaque, the second is completely transparent) and 10 (the first meter is completely transparent, the second is completely opaque). The value of this variable is set through ActionTimer plugin.
Here is a code to make all this. I didn't test it yet, so please test it and let me know if something is going wrong.

Code: Select all

[Rainmeter]
Update=1000

[Metadata]
Name=Chrome
Author=ANN0Y1NGHACEKR

[Variables]
Fade=0
U=[!UpdateMeasure "MeasureAlpha"][!UpdateMeterGroup "Chrome"][!Redraw]

[MeasureAlpha]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat FadeIn,10,10
FadeIn=[!SetVariable Fade "(Clamp((#Fade#+1),0,10))"]#U#
ActionList2=Repeat FadeOut,10,10
FadeOut=[!SetVariable Fade "(Clamp((#Fade#-1),0,10))"]#U#
DynamicVariables=1

[Chrome]
Meter=Image
ImageName=#@#Images\Square\chrome.png
H=68
LeftMouseDoubleClickAction=["C:\Users\*name*\Desktop\Google Chrome"]
MouseOverAction=[!CommandMeasure "MeasureAlpha" "Execute 1"][!CommandMeasure "MeasureAlpha" "Stop 2"]
MouseLeaveAction=[!CommandMeasure "MeasureAlpha" "Stop 1"][!CommandMeasure "MeasureAlpha" "Execute 2"]
ImageAlpha=(25.5*(10-#Fade#))
Group=Chrome
DynamicVariables=1

[Chrome2]
Meter=Image
ImageName=#@#Images\Square\chrome1.png
X=0r
Y=0r
H=68
LeftMouseDoubleClickAction=["C:\Users\*name*\Desktop\Google Chrome"]
MouseOverAction=[!CommandMeasure "MeasureAlpha" "Execute 1"][!CommandMeasure "MeasureAlpha" "Stop 2"]
MouseLeaveAction=[!CommandMeasure "MeasureAlpha" "Stop 1"][!CommandMeasure "MeasureAlpha" "Execute 2"]
ImageAlpha=(25.5*#Fade#)
Group=Chrome
DynamicVariables=1
ANN0Y1NGHACKER
Posts: 2
Joined: April 26th, 2018, 7:37 am

Re: Please help

Post by ANN0Y1NGHACKER »

Thanks alot, its works just like i wanted.
Image
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Please help

Post by balala »

ANN0Y1NGHACKER wrote:Thanks alot, its works just like i wanted.
Which one? Mor3bane's or my code?