It is currently April 19th, 2024, 11:18 am
Using ActionTimer to move entire skin
-
- Posts: 478
- Joined: February 26th, 2011, 10:22 pm
Using ActionTimer to move entire skin
I can't seem to find a way for ActionTimer to move an entire skin's X or Y position, only individual meters within the skin. Is this possible?
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Using ActionTimer to move entire skin
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[Variables]
U=[!UpdateMeasure Slider]
SkinX=600
[MeterDaBox]
Meter=Image
W=300
H=100
SolidColor=164,0,56,255
MouseOverAction=[!CommandMeasure Slider "Stop 2"][!CommandMeasure Slider "Execute 1"]
MouseLeaveAction=[!CommandMeasure Slider "Stop 1"][!CommandMeasure Slider "Execute 2"]
[Slider]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat SlideLeft, 1, 50
SlideLeft=[!SetVariable SkinX "(Clamp(#SkinX#-2,300,900))"][!Move "#SkinX#" "100"]#U#
ActionList2=Repeat SlideRight, 1, 50
SlideRight=[!SetVariable SkinX "(Clamp(#SkinX#+2,300,900))"][!Move "#SkinX#" "100"]#U#
DynamicVariables=1
With a little bit of work and some math, you could probably make it more like "move" than "place", by using the starting value (NOT the current value as you go) of #CURRENTCONFIGX#, which is the current position of the skin on the screen. Then add and subtract from that and apply it to the !Move bang to move the skin relative to where it "started" and not an absolute position. Tricky to manage if you drag the skin somewhere else while the skin is loaded.
To be honest, sorta goes against the grain for Rainmeter, as we see the position of skins on the screen something generally that the end-user should control by dragging, and the author controls where meters are within the skin. Unless "where the skin is on the screen" is integral to the functionality, I'd tend to be hesitant to use it. I would lean toward a skin that is big enough, even if full screen, to contain things, and set the background to be entirely invisible and undetectable with SolidColor=0,0,0,0. Then I would move the meters inside of that. But, to each his own...
You do not have the required permissions to view the files attached to this post.
-
- Posts: 17
- Joined: April 8th, 2020, 2:35 pm
- Location: PARIS - FRANCE
Re: Using ActionTimer to move entire skin
HI all,
Well, if I anderstand, if U click, the shape moves...
Is it possible (of course yes) to move the shape when you open the skin?
I tried and try to find a solution without sucess
Well, if I anderstand, if U click, the shape moves...
Is it possible (of course yes) to move the shape when you open the skin?
I tried and try to find a solution without sucess
Thanks for All
-
- Rainmeter Sage
- Posts: 7125
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Using ActionTimer to move entire skin
No, you don't understand:
- it's not the shape that moves (by the way, there is no shape in this skin, only a colored image), but the skin
- the movement is not triggered by a mouse click, but by mouse over / leave (i.e. hovering or not) on the skin
- it's not possible to move the skin when you "open" it, but it is however possible to move the skin when you load (or activate) it
- apparently, you didn't try hard enough, since simply moving the content of the MouseOverAction + MouseLeaveAction lines above (while separating them with a !Delay bang) to an OnRefreshAction option in the [Rainmeter] section of the skin does the trick:
Code: Select all
OnRefreshAction=[!CommandMeasure Slider "Stop 2"][!CommandMeasure Slider "Execute 1"][!Delay 3000][!CommandMeasure Slider "Stop 1"][!CommandMeasure Slider "Execute 2"]