It is currently May 4th, 2024, 2:51 am

mouseoveraction problem

Report bugs with the Rainmeter application and suggest features.
mitchel1029
Posts: 4
Joined: March 19th, 2013, 5:05 pm

mouseoveraction problem

Post by mitchel1029 »

I have a problem with mouseoveraction

just a bit of my code
--------
[MeterCPU]
Meter=Image
X=0
Y=0
W=1920
H=1080
ImageName=overlay_CPU.png
MouseOverAction=[!ShowMeterGroup CPUinfo][!Redraw]
MouseLeaveAction=[!HideMeterGroup CPUinfo][!Redraw]
------------

the problem is that not only this Meter works as mask. But every skin in my whole code works as a mask.

Does anybody know how to fix it?
User avatar
moshi
Posts: 1740
Joined: November 13th, 2012, 9:53 pm

Re: mouseoveraction problem

Post by moshi »

that meter is bigger than my screen, and probably exactly as big as yours. how does your mouse leave/enter it?
mitchel1029
Posts: 4
Joined: March 19th, 2013, 5:05 pm

Re: mouseoveraction problem

Post by mitchel1029 »

Yes it is as big as my screen but only the last 300 pixels at the x axis are visible.
Because the rest is opacity 0.
I did this to make sure it perfectly fits my background.
User avatar
Mr.Sadistic
Posts: 65
Joined: January 31st, 2013, 5:28 pm

Re: mouseoveraction problem

Post by Mr.Sadistic »

even with opacity 0, it is still there....

ie: even thought you do not see it, your mouse does....
mitchel1029
Posts: 4
Joined: March 19th, 2013, 5:05 pm

Re: mouseoveraction problem

Post by mitchel1029 »

but the mouse action doesn't work if the mouse is at the zero opacity.
But it does work when it is on a other skin an opacity > 0
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: mouseoveraction problem

Post by jsmorley »

I'm not quite sure what is going on here, but the way it works is:

With an image meter standing alone on the desktop, the mouse will not see any fully transparent part of an image. None of the mouse functions, LeftMouseUpAction / MouseOverAction etc. will detect the image on a fully transparent area.

If there is another meter in the skin that is not transparent, any area where the meters overlap will cause the meter with the transparent area to be seen as fully solid to the mouse. It doesn't matter which meter is in "front" or "back" of the other. Two meters that overlap will share a common "container" as far as the mouse detection is concerned.

This is also true if the BackgroundMode in [Rainmeter] is set with a SolidColor or image that is not fully transparent. Any meter in the skin will then be seen as fully solid as far as mouse detection is concerned, as the entire skin has a background that is not fully transparent.

However, this is "skin specific". In other words just moving a skin with an image meter that has a transparent area over another skin that has a solid area will not cause the mouse action in the first skin to be effected by the second.

One thing to be cautious about when making images is "fully transparent". Any hint of opacity, even 1/255 of a percent, is enough to be considered "fully solid" for mouse detection purposes.
mitchel1029
Posts: 4
Joined: March 19th, 2013, 5:05 pm

Re: mouseoveraction problem

Post by mitchel1029 »

Thanks

I just deleted the transparent part of the image and it worked!!!


So conclusion:
Every meter wich is ovelapping a transparrent meter is also used for mouse detection
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: mouseoveraction problem

Post by jsmorley »

mitchel1029 wrote:Thanks

I just deleted the transparent part of the image and it worked!!!


So conclusion:
Every meter wich is ovelapping a transparrent meter is also used for mouse detection
Not quite how I would put it, but close.

If a meter has a mouse action, any non-transparent area of the skin contained by that meter will be detected by the mouse. This may include overlapping meters either in front or back, or the overall skin background.

The way to envision it is that that for purposes of mouse detection there are no "layers" in a Rainmeter skin. All meters are just "drawn" as graphics on a single skin window, and Rainmeter doesn't know or care that any given pixel was created by Meter1 or Meter2. You can think of it as "a solid pixel in the skin has a mouse action" not "a meter has a mouse action" In fact, if both meters have a mouse "over" action, they are both executed, even in a case like this:

Code: Select all

[Rainmeter]
Update=1000

[MeterOne]
Meter=Image
W=50
H=50
SolidColor=255,0,0,255
MouseOverAction=[!SetOption MeterThree Text "MeterOne On"]
MouseLeaveAction=[!SetOption MeterThree Text "MeterOne Off"]

[MeterTwo]
Meter=Image
W=50
H=50
SolidColor=0,255,0,255
MouseOverAction=[!SetOption MeterFour Text "MeterFour On"]
MouseLeaveAction=[!SetOption MeterFour Text "MeterFour Off"]

[MeterThree]
Meter=String
Y=3R
FontSize=12
FontColor=255,255,255,255
Antialias=1
Text=MeterOne Off

[MeterFour]
Meter=String
Y=3R
FontSize=12
FontColor=255,255,255,255
Antialias=1
Text=MeterTwo Off