It is currently April 20th, 2024, 5:09 am

I have a bad memory - how to script mouseover image for multiple locations [solved]

Get help with creating, editing & fixing problems with skins
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

I have a bad memory - how to script mouseover image for multiple locations [solved]

Post by Mor3bane »

So, I have a png, it has 15 "buttons" on it. Generically they look like this:

Code: Select all


[Low0]
Meter=Image
SolidColor=0,0,0,1
X=487
Y=965
H=40
W=40
ToolTipText="..."
ToolTipType=1
MouseOverAction=
MouseLeaveAction=
LeftMouseDownAction=
RightMouseDownAction=
DynamicVariables=1
The X & Y are all different but this is the first one on the near-bottom of the screen. The H & W are all the same 32x32.

I have another png that is small, yep, 32x32. This would be my mouseover highlight, that would go away on mouseleave.

I tried to use the !SetOption Bang to 'dynamically' set the meter image - which is not actually set for any of the buttons as they are all integrated into the 'parent' image.
This did not work:

Code: Select all

MouseOverAction=[!SetOption "Low0" "ImageName" "Clicky.png"]
My poor memory just is blank tonight.

Any recommendations?
Last edited by Mor3bane on November 28th, 2019, 7:24 pm, edited 1 time in total.
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: 16147
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: I have a bad memory - how to script mouseover image for multiple locations

Post by balala »

Mor3bane wrote: November 28th, 2019, 8:26 am So, I have a png, it has 15 "buttons" on it.
There is one image with 15 buttons? Not sure I follow.
Mor3bane wrote: November 28th, 2019, 8:26 am

Code: Select all


[Low0]
Meter=Image
SolidColor=0,0,0,1
X=487
Y=965
H=40
W=40
ToolTipText="..."
ToolTipType=1
MouseOverAction=
MouseLeaveAction=
LeftMouseDownAction=
RightMouseDownAction=
DynamicVariables=1
The X & Y are all different but this is the first one on the near-bottom of the screen. The H & W are all the same 32x32.
The size of the above [Low0] meter is 40x40, not 32x32.
Mor3bane wrote: November 28th, 2019, 8:26 am This did not work:

Code: Select all

MouseOverAction=[!SetOption "Low0" "ImageName" "Clicky.png"]
Why? What happens when you're hovering the mouse over them?
Mor3bane wrote: November 28th, 2019, 8:26 am Any recommendations?
Yes, definitely. First please pack the whole config (take care to include all images) and upload the package.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: I have a bad memory - how to script mouseover image for multiple locations

Post by Mor3bane »

Hi, so the concept is that the visual area is fixed graphically at 32x32, ok?
However, the clickable area is 40x40 - I simplified that idea to streamline my request information. This is a minor thing, yes?
I cannot upload everything since I have personal information in the code and editing all of it out would dissolve the time I am trying to save, ok?

I have attached the images relevant to the visual aspect for your reference.

Perhaps with just that you may understand better.

I am more interested in not having repetitive code, than precision - so, yes the image - if a solution was provided precisely would be off but I was thinking I could adjust later on my own.
You do not have the required permissions to view the files attached to this post.
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: 16147
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: I have a bad memory - how to script mouseover image for multiple locations

Post by balala »

Mor3bane wrote: November 28th, 2019, 8:26 am This did not work:

Code: Select all

MouseOverAction=[!SetOption "Low0" "ImageName" "Clicky.png"]
Yes, this !SetOption doesn't work, because you have to vanish the set solid color. For this you have to add another !SetOption, which sets the SolidColor option empty. Beside this, I probably would also add a MouseLeaveAction, to set back the solid color when you're leaving the meter, but if you have / need this is completely up to you. So, here are the modified options:

Code: Select all

MouseOverAction=[!SetOption Low0 SolidColor ""][!SetOption Low0 ImageName "Clicky.png"][!UpdateMeter "Low0"][!Redraw]
MouseLeaveAction=[!SetOption Low0 SolidColor "0,0,0,1"][!SetOption Low0 ImageName ""][!UpdateMeter "Low0"][!Redraw]
Also note the added [!UpdateMeter "Low0"] and [!Redraw] bangs.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: I have a bad memory - how to script mouseover image for multiple locations

Post by Mor3bane »

Hmm, that does not seem to work.

I do not think there is anything else in play here as the graphical thing is all that is being changed.

The click events should not create any issue as the click is not part of the preferred outcome.

I also changed the canvas size of the Clicky.png to 40x40, making the alignment correct.

Not sure what is in play here, that could be causing the image not to appear...
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: 16147
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: I have a bad memory - how to script mouseover image for multiple locations

Post by balala »

Mor3bane wrote: November 28th, 2019, 7:08 pm Hmm, that does not seem to work.
Unfortunately with the code I had recreated it definitely does work.
I can't help more if I don't know the code. Please post at least the complete code, if you don't want to upload the packed config. However that would be the best, at least the code would be needed.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: I have a bad memory - how to script mouseover image for multiple locations

Post by Mor3bane »

Sorry!

The CLicky.png is in the Resources folder.

It as simple as:

Code: Select all

MouseOverAction=[!SetOption Low0 SolidColor ""][!SetOption Low0 ImageName "#@#Clicky.png"][!UpdateMeter "Low0"][!Redraw]
Thanks Balala. As per your regular kindness, your solution is perfect.
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: 16147
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: I have a bad memory - how to script mouseover image for multiple locations

Post by balala »

Mor3bane wrote: November 28th, 2019, 7:21 pm Sorry!

The CLicky.png is in the Resources folder.

It as simple as:

Code: Select all

MouseOverAction=[!SetOption Low0 SolidColor ""][!SetOption Low0 ImageName "#@#Clicky.png"][!UpdateMeter "Low0"][!Redraw]
Thanks Balala. As per your regular kindness, your solution is perfect.
Aha. I'm glad in this case. :thumbup: