It is currently March 28th, 2024, 11:30 pm

Help with a skin...

Get help with creating, editing & fixing problems with skins
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Help with a skin...

Post by kyriakos876 »

Hello,

I have this skin bellow which displays an animation whenever you click on it. The thing is that if you click and release the mouse button quickly, the ActionList1 isn't done and the ActionList2 kicks in. If you hold a little bit longer, like 400ms the thing works as expected. What I want to achive is:

Click and hold, the circle that spreaded.
Release click, the circle fades away.

Does anybody have any ideas how could I do that so that even if the click is fast, the ActionList1 will complete and then ActionList2 will take it's turn, but if you click and Hold down, the circle stays until you release.

(excuse the mess in the skins folder/ code...)

(You can also add: MouseLeaveAction=[!CommandMeasure AnimationController "Execute 2"] in the Rainmeter section in case you click and drag away.)

-Thanks in advance.
You do not have the required permissions to view the files attached to this post.
Last edited by kyriakos876 on September 6th, 2018, 11:06 am, edited 1 time in total.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: Help with a skin...

Post by Mor3bane »

have alook at this - i am not sure what you are looking for but it sounded like this example...
Grow-Shrink.ini
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
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Help with a skin...

Post by kyriakos876 »

Mor3bane wrote:have alook at this - i am not sure what you are looking for but it sounded like this example...
Grow-Shrink.ini
I'm afraid that this not what I'm trying to achive.... For a better understanding, you could open Chrome and if you have bookmarks, click and hold on one and see what happens, then release the button. Or if you have android 8 or 9 (I don't remember if this exists in 7 too) almost everywhere you tap, you see this little animation.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: Help with a skin...

Post by Mor3bane »

kyriakos876 wrote:I'm afraid that this not what I'm trying to achive.... For a better understanding, you could open Chrome and if you have bookmarks, click and hold on one and see what happens, then release the button. Or if you have android 8 or 9 (I don't remember if this exists in 7 too) almost everywhere you tap, you see this little animation.
best to google a gif with transparency. or possibly make one rather than trying to code it in RM. There are several online gif makers that have lots of cool functions.
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
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Help with a skin...

Post by kyriakos876 »

Mor3bane wrote:best to google a gif with transparency. or possibly make one rather than trying to code it in RM. There are several online gif makers that have lots of cool functions.
And I'll have to create a gif for a every meter? The problem isn't even the animation itself... the problem is the "how do I call the animation" to get the described behavior
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: Help with a skin...

Post by ikarus1969 »

I have made the following adaptions to your test skin (added 1 measure, adapted another measure and 1 meter) and for me it works.
Basically when releasing the left mouse-button i stop action 1 (the fade in of the circle) and start action 2.
Action 2 now "knows" how much steps for the fade-in are still necessary (the new measure "Measure_Steps_remaining") and repeats the fade in for exactly this number of steps. After that the normal fade-out takes place.

try it. i think it's ok.

Code: Select all

[Measure_Steps_remaining]
Measure=CALC
Formula=FLOOR(([Meter1:W] - #VarW#) / 7)
DynamicVariables=1

[AnimationController]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat Spread, 60, 20 
ActionList2=Repeat Spread, 60, [Measure_Steps_remaining]  | wait 7 | Repeat FadeOut, 24, 12 | wait 24 | Reset
Spread= [!SetVariable VarW (Clamp(#VarW#+7,0,[Meter1:W]))][!SetVariable VarH (Clamp(#VarH#+7,0,[Meter1:H]))][!Update][!Redraw]
FadeOut=[!SetVariable ClickAlpha (Clamp(#ClickAlpha#-7,0,45))]                                              [!Update][!Redraw]
Reset=  [!SetVariable VarW 0][!SetVariable VarH 0][!SetVariable ClickAlpha 45]                              [!Update][!Redraw]
DynamicVariables=1

[Meter1]
Meter=Image
SolidColor=255,255,255
W=200
H=50
X=0
Y=0
DynamicVariables=1
LeftMouseDownAction=[!CommandMeasure AnimationController "Execute 1"][!SetVariable MouseVarX $MouseX$ ][!SetVariable MouseVarY $MouseY$ ][!Update]
LeftMouseUpAction=  [!CommandMeasure AnimationController "Stop 1"][!CommandMeasure AnimationController "Execute 2"][!Update]
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: Help with a skin...

Post by kyriakos876 »

ikarus1969 wrote:I have made the following adaptions to your test skin (added 1 measure, adapted another measure and 1 meter) and for me it works.
Basically when releasing the left mouse-button i stop action 1 (the fade in of the circle) and start action 2.
Action 2 now "knows" how much steps for the fade-in are still necessary (the new measure "Measure_Steps_remaining") and repeats the fade in for exactly this number of steps. After that the normal fade-out takes place.

try it. i think it's ok.
Yes! This works nice. Thanks for the idea! (I only changed the speed of the animation instead of 60ms I set it to 20 and 24)
Last edited by kyriakos876 on September 6th, 2018, 11:01 am, edited 1 time in total.
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: Help with a skin...

Post by ikarus1969 »

You're welcome!