It is currently April 18th, 2024, 12:54 pm

!SetOptionGroup is not working

Get help with creating, editing & fixing problems with skins
User avatar
Active Colors
Moderator
Posts: 1251
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

!SetOptionGroup is not working

Post by Active Colors »

I have holidays and will bother you with my problems little more. For now I have !SetOptionGroup bang not working in my skin. In my skin I want to set ImageAlpha to 0 for all meters in group CnsGrpAniFade. But no luck. Here is my code. I probably again overlook something small in making skins.

Code: Select all

[CnsObjButton]
AntiAlias=1
Hidden=0
UpdateDivider=-1
DynamicVariables=1

[CnsObjButtonFade]
ImageAlpha=255
Group=CnsGrpAniFade

[ObjSlideOpenIn]
Meter=Image
MeterStyle=CnsObjButton | CnsObjButtonFade
ImageName=#@#Core\Graphics\Slideshow\picture2.png
X=0
Y=0
MouseOverAction=[!SetOptionGroup CnsObjButtonFade ImageAlpha 0][!UpdateMeterGroup CnsGrpAniFade][!Redraw]
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: !SetOptionGroup is not working

Post by jsmorley »

One thing to be careful about with an alpha of "0" is that when something is fully transparent, it won't detect the mouse. You might want to use an alpha of "1" if you want to turn something invisible, but still have it detect the mouse.
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: !SetOptionGroup is not working

Post by fonpaolo »

For what I see, there's something wrong:
MouseOverAction=[!SetOptionGroup CnsObjButtonFade ImageAlpha 0][!UpdateMeterGroup CnsGrpAniFade][!Redraw]
If it's a group, you have to use CnsGrpAniFade
...or if it's a meter, you have to use !SetOption

I'm not using styles that way, correct me if I'm wrong, but you're trying to change a style dinamically...
I'm a little confused, usually the group is defined in every meter and/or measure, never used in a style. :confused:
User avatar
balala
Rainmeter Sage
Posts: 16143
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: !SetOptionGroup is not working

Post by balala »

Active Colors wrote:I have holidays and will bother you with my problems little more. For now I have !SetOptionGroup bang not working in my skin. In my skin I want to set ImageAlpha to 0 for all meters in group CnsGrpAniFade. But no luck. Here is my code. I probably again overlook something small in making skins.
As you very well said, the name of the group is CnsGrpAniFade, not CnsObjButtonFade, as you've used in the !SetOptionGroup bang. [CnsObjButtonFade] is the name of a meter style.
So, replace this bang of the MouseOverAction option in the [ObjSlideOpenIn] meter, with [!SetOptionGroup CnsGrpAniFade ImageAlpha 0].
Also, as jsmorley said, maybe you should take into account to not set the ImageAlpha to 0, but to 1, instead.

EDIT: again fonpaolo was a bit quicker than me.
User avatar
balala
Rainmeter Sage
Posts: 16143
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: !SetOptionGroup is not working

Post by balala »

fonpaolo wrote:I'm a little confused, usually the group is defined in every meter and/or measure, never used in a style. :confused:
It can be defined this way, there is no problem with this. In such cases each meter using the style will be included into that group.
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: !SetOptionGroup is not working

Post by fonpaolo »

balala wrote:It can be defined this way, there is no problem with this. In such cases each meter using the style will be included into that group.
Well, I never thought about the styles in this way... and I always try to find shortcuts. O.O
User avatar
Active Colors
Moderator
Posts: 1251
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Re: !SetOptionGroup is not working

Post by Active Colors »

Thank you a lot everyone. I just simply overlooked what I copied.
jsmorley wrote:One thing to be careful about with an alpha of "0" is that when something is fully transparent, it won't detect the mouse. You might want to use an alpha of "1" if you want to turn something invisible, but still have it detect the mouse.
In my real skin I have different more complicated actions. I just used this straightforward case for demonstration purpose only. Though, thank you for the clarification.
User avatar
Active Colors
Moderator
Posts: 1251
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Re: !SetOptionGroup is not working

Post by Active Colors »

jsmorley wrote:One thing to be careful about with an alpha of "0" is that when something is fully transparent, it won't detect the mouse. You might want to use an alpha of "1" if you want to turn something invisible, but still have it detect the mouse.
I just checked it and it is not true. I set imagealpha to 0 in imagemeter and it still reacts when I hover it.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: !SetOptionGroup is not working

Post by jsmorley »

Active Colors wrote:I just checked it and it is not true. I set imagealpha to 0 in imagemeter and it still reacts when I hover it.
No it doesn't....

However, if you have any solid meter or skin background "behind" the image, the mouse detection will "fall through" to them and it will have the effect of the mouse being detected on the image.

What the mouse detection is asking is "is there a solid pixel where the mouse currently is, and is it within the boundaries of the meter where the mouse action option is set?"

I'm not in love with how Rainmeter works in this respect, but it is what it is. A skin is not distinct "objects" at the end of the day, but simply a single "canvas" that all meters are drawn on. So after the skin window is drawn, Rainmeter doesn't know or care "who" drew a particular pixel on the screen, it just knows if it is solid or not. All it can do is ask the above question...

We have changed this behavior for the new Shape meter, but to do so with all meters would cause just hideous backwards compatibility issues. The only other meter that has what I would consider to be more logical behavior is the Button meter, which does, and always did, only react to solid pixels created by the button image.

Still, what I said initially is literally true. Any meter with an alpha of "0" will not detect the mouse. Assuming otherwise will only lead to tears...
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: !SetOptionGroup is not working

Post by fonpaolo »

The only way it will react, is that your image meter with alpha "0" is on top of another image meter with alpha more than "0".

edit: answered before reading all... :lol: