It is currently March 29th, 2024, 12:42 am

Change position on hover

Get help with creating, editing & fixing problems with skins
Arman
Posts: 2
Joined: September 22nd, 2017, 1:40 pm

Change position on hover

Post by Arman »

Hey guys!

I've been trying to figure out how to change the position of the skin on hover.

What I only managed to do was find the MouseOverAction and MouseLeaveAction.

Code: Select all

[Rainmeter]
Update=100
X=0R
Y=0R
MouseOverAction= [!SetOption X "150R" ][!Redraw]
MouseLeaveAction= [!SetOption X "0R"][!Redraw]
Also, changing X and Y themselves doesn't do anything. I have to manually move the skin where I would like to.
User avatar
theimmersion
Posts: 55
Joined: November 27th, 2016, 1:51 pm

Re: Change position on hover

Post by theimmersion »

SetOptions doesnt work like that. Check the documentations again.
For instance:

Code: Select all

[Rainmeter]
Update=100
MouseOverAction= [!SetOption MeterText X "150" ][!Redraw]
MouseLeaveAction= [!SetOption MeterText X "0"][!Redraw]

[MeterText]
Meter=String
Text=HELLO!

Also, if your trying to move the skin itself, you cant do it that way.
You can only move the meters around like that. Also, for the R to work, it needs a reference before that meter but i dont know if you can add R with SetOption. Best would be to post a bit more of your code and explain what it is the move would achieve. Like, do you want to align to something (screen dimensions) or align to a different skin or meter or do you want to center it? What is its purpose. ^^
Last edited by theimmersion on September 22nd, 2017, 3:28 pm, edited 1 time in total.
Arman
Posts: 2
Joined: September 22nd, 2017, 1:40 pm

Re: Change position on hover

Post by Arman »

theimmersion wrote:SetOptions doesnt work like that. Check the documentations again.
For instance:

[Rainmeter]
Update=100
MouseOverAction= [!SetOption MeterText X "150" ][!Redraw]
MouseLeaveAction= [!SetOption MeterText X "0"][!Redraw]

[MeterText]
Meter=String
Text=HELLO!


Also, if your trying to move the skin itself, you cant do it that way.
You can only move the meters around like that. Also, for the R to work, it needs a reference before that meter but i dont know if you can add R with SetOption. Best would be to post a bit more of your code and explain what it is the move would achieve. Like, do you want to align to something (screen dimensions) or align to a different skin or meter or do you want to center it? What is its purpose. ^^
Ah, I see. My original intention was to move the skin itself on hover, but I guess not. Thanks for the reply.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Change position on hover

Post by balala »

In addition to theimmersion's reply, you have to know that probably you're making a confusion: moving a skin or moving a meter of it are not the same things. You can't position a skin (which you did) with the X and Y options, added to the [Rainmeter] section. You simply can't use them there, not being allowed. But even if they would be, you can't change dynamically any options of the [Rainmeter] section. See the last section ("What !SetOption can change and what it can't") of this: https://docs.rainmeter.net/tips/setoption-guide/
However you can move the skin itself, using the !Move bang. So, replace your [Rainmeter] section with something like the following one:

Code: Select all

[Rainmeter]
Update=100
MouseOverAction=[!Move "New-Horizontal-Position" "New-Vertical-Position"]
MouseLeaveAction=[!Move "Original-Horizontal-Position" "Original-Vertical-Position"]
where obviously New-Horizontal-Position, New-Vertical-Position, Original-Horizontal-Position and Original-Vertical-Position are the exact horizontal and vertical positions of the skin, given as numbers. Relative positioning of a skin is not allowed.
Also note that the posted !SetOption bangs are not correct. A such bang requires three (or sometimes even four) parameters: the name of the appropriate section, the name of the options of previously given section and its new value. If it's needed, you can also add a fourth parameter, the config where you want to apply the new option, if this is another one. But two parameters are not enough (X and "150R" in your example).
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Change position on hover

Post by balala »

theimmersion wrote:[Rainmeter]
Update=100
MouseOverAction= [!SetOption MeterText X "150" ][!Redraw]
MouseLeaveAction= [!SetOption MeterText X "0"][!Redraw]

[MeterText]
Meter=String
Text=HELLO!
theimmersion, please always use the code tags (through the Code button above the field where you're writing you reply), whenever you're posting codes:

Code: Select all

[Rainmeter]
Update=100
MouseOverAction= [!SetOption MeterText X "150" ][!Redraw]
MouseLeaveAction= [!SetOption MeterText X "0"][!Redraw]

[MeterText]
Meter=String
Text=HELLO!
User avatar
theimmersion
Posts: 55
Joined: November 27th, 2016, 1:51 pm

Re: Change position on hover

Post by theimmersion »

Sorry! Not used to posting much on forums. :oops:
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Change position on hover

Post by balala »

theimmersion wrote:Sorry! Not used to posting much on forums. :oops:
No problem. I just said you to know for further postings.