It is currently April 26th, 2024, 2:15 am

Using New Idea [borrowed] for a skin to fade in or out with mouse scroll up/down [solved]

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

Using New Idea [borrowed] for a skin to fade in or out with mouse scroll up/down [solved]

Post by Mor3bane »

Hello,

@itsjustryan was doing something a fade button that would use action timer.

I wish to do the same thing but managed by mousescroll instead of actiontimer.

I tried to exract what seemed necessary, but I am not getting it.

Code: Select all

[Rainmeter]
Update=1000

[Variables]
Alpha=0
Step=0

[FadeCalc]
Measure=Calc
Formula=#Step#
MinValue=0
MaxValue=255
DynamicVariables=1

[MeterImage]
Meter=Image
ImageAlpha=#Alpha#
X=0
Y=0
W=1920
H=1080
MouseScrollDownAction=[!SetVariable Alpha "(Clamp((#Alpha#+25.5),0,255))"][!Redraw]
MouseScrollUpAction=[!SetVariable Alpha "(Clamp((#Alpha#-25.5),0,255))"][!Redraw]
SolidColor=0,0,0
DynamicVariables=1
Any help would be really cool.
Thanks.
Last edited by Mor3bane on January 25th, 2020, 11: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: 16172
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Using New Idea [borrowed] for a skin to fade in or out with mouse scroll up/down

Post by balala »

Mor3bane wrote: January 25th, 2020, 6:19 am Any help would be really cool.
The posted code requires a small adjustment, but it does work. What you should modify is that if the transparency is set to 0, the meter doesn't react anymore to the scroll, so you should either change the limits of the Clamp function to 1, respectively 255 (along with changing the value of the Alpha variable within the [Variables] section to Alpha=1), or should modify the SolidColor option to SolidColor=0,0,0,1 (not required both). Additionally three other comments:
  • I hope you've set an ImageName option on the meter, right?
  • I also would add a !UpdateMeter bang to the same MouseScrollDownAction and MouseScrollUpAction options, to get the meter updated immediately when you're scrolling:

    Code: Select all

    [MeterImage]
    ...
    MouseScrollDownAction=[!SetVariable Alpha "(Clamp((#Alpha#+25.5),1,255))"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
    MouseScrollUpAction=[!SetVariable Alpha "(Clamp((#Alpha#-25.5),1,255))"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
  • What is the [FadeCalc] measure for? I suppose this isn't the entire code, just part of it, right?
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: Using New Idea [borrowed] for a skin to fade in or out with mouse scroll up/down

Post by Mor3bane »

What is the [FadeCalc] measure for? I suppose this isn't the entire code, just part of it, right?
It is grandfathered in from itsjustryan's code you were helping him with. I take that question as relative to it's apparent usefulness = 0.
I hope you've set an ImageName option on the meter, right?
Is the image needing to be something specific or is a default alpha of 50% adequate or needed?
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
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: Using New Idea [borrowed] for a skin to fade in or out with mouse scroll up/down

Post by Mor3bane »

Well things seem to be working, but it is inconsistent -

For instance it will stop fading and default to -100% (0), even with the clamp min set to 1. This happens when I click off of the skin. If focus remains on the skin then scroll works fine. Also, I am not able to reassert the focus with a mouse click until I open rainmeter manager and manually set the transparency to (yes..) 0% - unfocus again and it fails again.

So I am trying to have several functions on the Blackout.ini. Getting them to work is another thing...

Also is it possible to toggle click-through, and to also make not click-through the default, so as to be able to click to switch off no click-through.

Oh - sorry. I forgot to say what this is meant to be:
I have multiple displays - being able to block them out makes movie watching easier. The scroll option is to reveal the skins underneath to get the time or any other skin outputs (weather etc, etc.).
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: 16172
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Using New Idea [borrowed] for a skin to fade in or out with mouse scroll up/down

Post by balala »

Mor3bane wrote: January 25th, 2020, 7:38 am Is the image needing to be something specific or is a default alpha of 50% adequate or needed?
Any image is adequate, but if you're using SolidColor, it doesn't work this way. If using SolidColor, you have to add the #Alpha# variable as the fourth color parameter: SolidColor=255,240,0,#Alpha# and have to remove the ImageAlpha option. If using ImageAlpha, ImageName or MeasureName is required.
User avatar
balala
Rainmeter Sage
Posts: 16172
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Using New Idea [borrowed] for a skin to fade in or out with mouse scroll up/down

Post by balala »

Mor3bane wrote: January 25th, 2020, 7:58 am Well things seem to be working, but it is inconsistent -

For instance it will stop fading and default to -100% (0), even with the clamp min set to 1. This happens when I click off of the skin. If focus remains on the skin then scroll works fine. Also, I am not able to reassert the focus with a mouse click until I open rainmeter manager and manually set the transparency to (yes..) 0% - unfocus again and it fails again.
Any of the following codes works well for me:

Code: Select all

[Variables]
Alpha=0

...

[MeterImage]
Meter=Image
ImageName=#@#Image.png
ImageAlpha=#Alpha#
X=0
Y=0
W=1920
H=1080
MouseScrollDownAction=[!SetVariable Alpha "(Clamp((#Alpha#+25.5),0,255))"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseScrollUpAction=[!SetVariable Alpha "(Clamp((#Alpha#-25.5),0,255))"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
SolidColor=0,0,0,1
DynamicVariables=1
or:

Code: Select all

[Variables]
Alpha=1

...

[MeterImage]
Meter=Image
ImageName=#@#Image.png
ImageAlpha=#Alpha#
X=0
Y=0
W=192
H=108
MouseScrollDownAction=[!SetVariable Alpha "(Clamp((#Alpha#+25.5),1,255))"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
MouseScrollUpAction=[!SetVariable Alpha "(Clamp((#Alpha#-25.5),1,255))"][!UpdateMeter "#CURRENTSECTION#"][!Redraw]
;SolidColor=0,0,0,1
DynamicVariables=1
Mor3bane wrote: January 25th, 2020, 7:58 am So I am trying to have several functions on the Blackout.ini. Getting them to work is another thing...
If you can't get it working, please post the whole code or even better, pack and upload the config.
Mor3bane wrote: January 25th, 2020, 7:58 am Also is it possible to toggle click-through, and to also make not click-through the default, so as to be able to click to switch off no click-through.
The following option sets the click-through, when you load / refresh the skin:

Code: Select all

[Rainmeter]
...
OnRefreshAction=[!ClickThrough "1"]
Or you can toggle it by a click:

Code: Select all

[AnyMeter]
...
LeftMouseUpAction=[!ClickThrough "-1"]
https://docs.rainmeter.net/manual/bangs/#ClickThrough
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: Using New Idea [borrowed] for a skin to fade in or out with mouse scroll up/down

Post by Mor3bane »

That is the whole skin.

Now it isnt working at all. There are no errors in the log. No other notices or otherwise indicators of a skin error.
Blackout_1.0.rmskin
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
Jeff
Posts: 332
Joined: September 3rd, 2018, 11:18 am

Re: Using New Idea [borrowed] for a skin to fade in or out with mouse scroll up/down

Post by Jeff »

Why not use !SetTransparency to fade the whole skin
User avatar
balala
Rainmeter Sage
Posts: 16172
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Using New Idea [borrowed] for a skin to fade in or out with mouse scroll up/down

Post by balala »

Mor3bane wrote: January 25th, 2020, 11:06 am Now it isnt working at all. There are no errors in the log. No other notices or otherwise indicators of a skin error.
Normally, because if you set the skin to ClickThrough, it doesn't interact with the mouse. Neither right- or left-click, nor scrolling. If you remove the OnRefreshaction and the LeftMouseUpAction option of the [MeterImage] meter AND you disable the clickthrough (right clicking the skin, going to Settings and unchecking the ClickThrough checkbox), it will start working. Note that if the OnRefreshAction is there it dosen't work, because when loaded / refreshed the skin is set to clickthrough and if the LeftMouseUpAction is there it doesn't work after the first click, because at this click is it set to clickthrough.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: Using New Idea [borrowed] for a skin to fade in or out with mouse scroll up/down

Post by Mor3bane »

I tried the autohotkey suggestion by Jeff - the skin works but it seems attaining focus is not the reason for this:
When the skin is first loaded it works fine - until I click in a different screen - the it stops and remains at whatever value of transparency.
The reason i thought it to be a focus issue is if and only if - once the fade fails to respond - i click on the rainmeter manager, functionality is restored.

Code: Select all

[Rainmeter]
Update=500
MouseOverAction=["#CURRENTPATH##@#stealfocus.ahk" "#CURRENTPATH##CURRENTFILE#"]

[Variables]
Alpha=1

[MeterImage]
Meter=Image
ImageName=#@#Fifty.png
ImageAlpha=#Alpha#
X=0
Y=0
W=1920
H=1080
MouseScrollUpAction=[!WriteKeyValue "Variables" "Alpha" "(Clamp((#Alpha#+25.0),0,255))" "#CURRENTSECTION#"][!Redraw]
MouseScrollDownAction=[!WriteKeyValue "Variables" "Alpha" "(Clamp((#Alpha#-25.0),0,255))" "#CURRENTSECTION#"][!Redraw]
SolidColor=0,0,0
DynamicVariables=1
The ahk file is in the @Resources folder - it is being recognised but that only means it is not a simple focus issue - something is breaking this when I click to another display the return to mouseover, left or right click on the blackout does nothing then.
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.