It is currently April 19th, 2024, 7:12 pm

Hover Over Image Change Issue

Get help with creating, editing & fixing problems with skins
jeremyfto
Posts: 2
Joined: April 25th, 2018, 6:38 pm

Hover Over Image Change Issue

Post by jeremyfto »

Hi! So I am fairly new to rainmeter and the scripting it is built on. I am trying to modify a honeycomb skin to change the image of the honeycomb when mouse is hovered over it and change back when it is not hovered over it. I still can't figure out what the issue is. Here my my code:

Code: Select all

 
[smite]
Meter=Image
ImageName=#@#Images\smite.png
H=90
MouseOverAction=[!SetOption ImageName "#@#Images\smiteALT.png"]
MouseLeaveAction=[!SetOption ImageName "#@#Images\smite.png"]
LeftMouseUpAction=["steam://rungameid/386360"]
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: Hover Over Image Change Issue

Post by fonpaolo »

Try:

Code: Select all

MouseOverAction=[!SetOption smite ImageName "#@#Images\smiteALT.png"]
MouseLeaveAction=[!SetOption smite ImageName "#@#Images\smite.png"]
User avatar
balala
Rainmeter Sage
Posts: 16145
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Hover Over Image Change Issue

Post by balala »

jeremyfto wrote:Hi! So I am fairly new to rainmeter and the scripting it is built on. I am trying to modify a honeycomb skin to change the image of the honeycomb when mouse is hovered over it and change back when it is not hovered over it. I still can't figure out what the issue is.
EDIT: Sorry fonpaolo, it seems you beat me (again)...

The !SetOption bang needs three parameters, not just two, as you have in your code. So, add the needed section name:

Code: Select all

[smite]
...
MouseOverAction=[!SetOption smile ImageName "#@#Images\smiteALT.png"][!UpdateMeter "smile"][!Redraw]
MouseLeaveAction=[!SetOption smile ImageName "#@#Images\smite.png"][!UpdateMeter "smile"][!Redraw]
or:

Code: Select all

[smite]
...
MouseOverAction=[!SetOption #CURRENTSECTION# ImageName "#@#Images\smiteALT.png"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# ImageName "#@#Images\smite.png"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
As you can see, I also added bangs to update the meter and redraw the skin.
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: Hover Over Image Change Issue

Post by fonpaolo »

The syntax is:
!SetOption, Measure or meter, parameter, new value.
You can also use:

Code: Select all

MouseOverAction=[!SetOption "#CURRENTSECTION#" ImageName "#@#Images\smiteALT.png"]
MouseLeaveAction=[!SetOption "#CURRENTSECTION#" ImageName "#@#Images\smite.png"]
In this case, #CURRENTSECTION# is the current meter where you have the bangs.
...and as balala said, don't forget to add Update and Redraw.
(I only corrected the bang)
User avatar
balala
Rainmeter Sage
Posts: 16145
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Hover Over Image Change Issue

Post by balala »

fonpaolo wrote:The syntax is:
!SetOption, Measure or meter, parameter, new value.
Not to comment you reply, but I think you should have to be a bit more precise. In the syntax of the !SetOption bang (or any other bang), the commas and the dot are not necessary. The syntax would be: !SetOption Section Parameter "new value", where obviously Section have to be a measure or a meter (the bang can't be used to set options of the, for example [Rainmeter] section). I also added the quotations around the new value, especially that it contains a space.
Please forgive me fonpaolo, but this had to be said, just to not create confusion to a new user (what jeremyfto is, as he said).
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: Hover Over Image Change Issue

Post by fonpaolo »

I was just describing the syntax, explaining why it didn't work, as described in the docs "Meter/Measure, Option, Value".
However, as always you're right, balala, using the correct Rainmeter syntax.
User avatar
balala
Rainmeter Sage
Posts: 16145
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Hover Over Image Change Issue

Post by balala »

fonpaolo wrote:However, as always you're right, balala, using the correct Rainmeter syntax.
Thanks for the appreciations, fonpaolo...
jeremyfto
Posts: 2
Joined: April 25th, 2018, 6:38 pm

Re: Hover Over Image Change Issue

Post by jeremyfto »

You guys are awesome! This takes my desktop to the next level. I appreciate it so much!!!