Hi everyone,
Is it possible to move a skin with mouse's desktop positions ? Like if the mouse is at the left of the screen, the skin move to the right...
I searched on Rainmeter's manual some elements but i didn't understand everything (maybe because i'm bad in english and i begin programing ).
I hope i was understandable, i don't speak often English...
It is currently April 19th, 2024, 2:53 am
Move skin with mouse
-
- Posts: 5
- Joined: June 22nd, 2017, 6:11 pm
-
- Posts: 908
- Joined: December 30th, 2015, 9:47 am
Re: Move skin with mouse
Just one solution, use MouseXY plugin.
https://forum.rainmeter.net/viewtopic.php?p=126924
Below is a sample code which moves other skin following mouse position. Modify as you like.
EDIT: original code may disable mouse operation in some situation, sorry.
https://forum.rainmeter.net/viewtopic.php?p=126924
Below is a sample code which moves other skin following mouse position. Modify as you like.
Code: Select all
[Rainmeter]
Update=1000
BackgroundMode=2
SolidColor=0,0,0,1
[MeasureMouseX]
Measure=Plugin
Plugin=MouseXY
Dimension=X
MaxValue=#SCREENAREAWIDTH#
[MeasureMouseY]
Measure=Plugin
Plugin=MouseXY
Dimension=Y
MaxValue=#SCREENAREAHEIGHT#
[MoveMeasure]
Measure=Calc
Formula=1
IfConditionMode=1
IfCondition=MoveMeasure=1
IfTrueAction=[!Move ([MeasureMouseX]+10) ([MeasureMouseY]+10) yourskin]
DynamicVariables=1
[DummyMeter]
Meter=Image
SolidColor=0,0,0,1
X=0
Y=0
W=1
H=1
-
- Posts: 5
- Joined: June 22nd, 2017, 6:11 pm
Re: Move skin with mouse
Thank you, mak_kawa, for this fast answer !
I'll try it now !
I'll try it now !
-
- Posts: 5
- Joined: June 22nd, 2017, 6:11 pm
Re: Move skin with mouse
Hi again !
Finaly, when i move the mouse, the skin follows the mouse. But when i modify the code to move the skin to the right when the mouse is at left of the screen, the skin just block at (0,0)
What i simply modified is :
I thought incrementing x by 10 would move the skin 10 pixels to the right, but it wont... Is it a wrong notation ? Or maybe we have to create a new variable ?
Finaly, when i move the mouse, the skin follows the mouse. But when i modify the code to move the skin to the right when the mouse is at left of the screen, the skin just block at (0,0)
What i simply modified is :
Code: Select all
[MoveMeasure]
Measure=Calc
Formula=1
IfConditionMode=1
IfCondition=MeasureMouseX<10
IfTrueAction=[!Move (x+10) y]
DynamicVariables=1
-
- Rainmeter Sage
- Posts: 16144
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Move skin with mouse
What you mean by =[!Move (x+10) y]? In Rainmeter (unlike in any programming languages) you can't simply use x and y, as you did.scottsq wrote:I thought incrementing x by 10 would move the skin 10 pixels to the right, but it wont... Is it a wrong notation ? Or maybe we have to create a new variable ?
If they are variables, the correct form of the bang would be: =[!Move "(#x#+10)" "#y#"] (note that I also added some quotation marks, which are preferably to be used).
If they are not, then indeed, would be a good idea to create those variables.
-
- Posts: 908
- Joined: December 30th, 2015, 9:47 am
Re: Move skin with mouse
Hi scottsq
To solve the problem efficiently, please post the whole flow of your working code.
To solve the problem efficiently, please post the whole flow of your working code.
-
- Posts: 5
- Joined: June 22nd, 2017, 6:11 pm
Re: Move skin with mouse
It works with some added variables !
Hereis the full code, which is fonctional :
If you tell me how to post a video here, i can show you the results
Hereis the full code, which is fonctional :
Code: Select all
[Rainmeter]
Update=25
[Variables]
A=0
B=0
[MoveMeasure]
Measure=Calc
Formula=1
IfConditionMode=1
IfCondition=(MeasureMouseX<10) && (#A#<0)
IfTrueAction=[!Move "(#A#+10)" "(#B#)"][!setvariable A "(#A#+10)"]
IfConditionMode2=1
IfCondition2=(MeasureMouseX>1360) && (#A#>-1032)
IfTrueAction2=[!Move "(#A#-10)" "(#B#)"][!setvariable A "(#A#-10)"]
IfConditionMode3=1
IfCondition3=(MeasureMouseY>763) && (#B#>-1027)
IfTrueAction3=[!Move "(#A#)" "(#B#-10)"][!setvariable B "(#B#-10)"]
IfConditionMode4=1
IfCondition4=(MeasureMouseY<10) && (#B#<-1)
IfTrueAction4=[!Move "(#A#)" "(#B#+10)"][!setvariable B "(#B#+10)"]
IfCondition5=#A#<-1033
DynamicVariables=1
[MeterBackground]
Meter=image
ImageName="path\the_image.png"
antialias=1
x=0
y=0
dynamicvariables=1
[MeasureMouseX]
Measure=Plugin
Plugin=MouseXY
Dimension=X
MaxValue=#SCREENAREAWIDTH#
[MeasureMouseY]
Measure=Plugin
Plugin=MouseXY
Dimension=Y
MaxValue=#SCREENAREAHEIGHT#
-
- Posts: 908
- Joined: December 30th, 2015, 9:47 am
Re: Move skin with mouse
Hi scottsq
Some points I have noticed.
1. IfConditionMode2=1 IfConditionMode3=1 IfConditionMode4=1 are needless at all, because IfConditionMode=1 is effective throughout IfConditionN part in one measure.
2. dynamicvariables=1 in [MeterBackground] is unnecessary, because no variables are in this meter.
No, not necessary for me. I am glad that your code is now workable.i can show you the results
Some points I have noticed.
1. IfConditionMode2=1 IfConditionMode3=1 IfConditionMode4=1 are needless at all, because IfConditionMode=1 is effective throughout IfConditionN part in one measure.
2. dynamicvariables=1 in [MeterBackground] is unnecessary, because no variables are in this meter.
-
- Posts: 5
- Joined: June 22nd, 2017, 6:11 pm
Re: Move skin with mouse
Ok thank you for those tips !
And thank you all for helping me ! it was really helpfull
And thank you all for helping me ! it was really helpfull