That is exactly what I already have. And for some reason, the skin doesn't move. See my code:death.crafter wrote: ↑September 15th, 2021, 4:53 pm Ohh, then use move bang to move the skin.
And leftmouseupaction should be used in the measure and not the meter.
But still, I would just make a measure that calculates the position of a grid according to current skin x and y, then make a measure for moving the skin to that position. If you know lua then the job would be far lot easier.
Currently I can't provide an example of what I am saying because I broke my pc and I don't know when will it be back but once it's back I will provide an example.
Code: Select all
[Rainmeter]
Update=-1
[Variables]
GridSize=80
MyXPos=0
MyYPos=0
;========== Measures
[MeasureMouse]
Measure=Plugin
Plugin=Mouse
DynamicVariables=1
RelativeToSkin=0
LeftMouseDownAction=[!Log "Old coordinates [MeasureX] [MeasureY]"]
LeftMouseUpAction=[!CommandMeasure MeasureMouse "Stop"][!UpdateMeasure "MeasureX"][!UpdateMeasure "MeasureY"][!Log "New coordinates [MeasureX] [MeasureY]"][!UpdateMeasure "Mover"]
[MeasureX]
Measure=Calc
Formula=(Floor(#CURRENTCONFIGX#/#GridSize#)*#GridSize#)
DynamicVariables=1
OnUpdateAction=[!SetVariable "MyXPos" [MeasureX]]
[MeasureY]
Measure=Calc
Formula=(Floor(#CURRENTCONFIGY#/#GridSize#)*#GridSize#)
DynamicVariables=1
OnUpdateAction=[!SetVariable "MyYPos" [MeasureY]]
[Mover]
Measure=Calc
Formula=0
DynamicVariables=1
OnUpdateAction=[!Move [MeasureX] [MeasureY]] [!Log "I moved to [MeasureX] [MeasureY]"]
;========== Meter
[RoundBase]
Meter=Roundline
MeterStyle=Round
LineColor=60,180,60
X=0
Y=0
W=#GridSize#
H=#GridSize#
LineStart=0
LineLength=(#GridSize# / 2)
StartAngle=(Rad(0))
RotationAngle=(Rad(360))
Solid=1
Antialias=1