It is currently September 20th, 2019, 9:16 pm

Universal Transitions

Discuss the use of Lua in Script measures.
User avatar
Kaelri
Developer
Posts: 1739
Joined: July 25th, 2009, 4:47 am

Re: Universal Transitions

Kaelri » September 19th, 2012, 12:53 am

lysy1993lbn wrote:It's just awesome! I totally love it :D

But.. what about groups? I'd like to make my dock slide on hover, do I have to apply 14 bangs to do it?
From the original post:
Kaelri wrote:Variables

All of the bangs above have an optional variable name parameter. If supplied, the transition changes this variable's value, instead of meter options. (You must still provide the name of at least one meter to be updated during the transition.) The variable name 'Auto' will use the default ("automatic") behavior.

!CommandMeasure Transition "MoveByX('MeterName', 120, 'VariableName')"

You may also use meter groups if you target a variable. You can mix meters and groups however you want. This can be useful if you want one transition to affect a large number of meters, or if the automatic behavior is not what you want.
lysy1993lbn wrote:Or is possible to move whole skin from another one?
Now I have separate skin to show with fade effect my dock which basically trigger MouseOverAction=[!ShowFade "woodock"][!Hide "woodock\$widgets\position"] at hover on it.
You could easily modify the script to move skins instead of meters. However, you would need a way to get the starting location of the other skin. You can see this thread for some ideas on how to do that.
lysy1993lbn
Posts: 286
Joined: July 25th, 2011, 9:53 am
Location: Manchester, UK

Re: Universal Transitions

lysy1993lbn » September 30th, 2012, 12:57 pm

I managed to do this simply using relative position for all meters in skin. Worsk flawless :)
Thanks again for that script :thumbup:
"Never argue with an idiot, he will drag you down to his level and beat you with experience."
my deviantART | Alternative Rainmeter tray icons
User avatar
ScoobSTi
Posts: 135
Joined: September 12th, 2012, 10:49 pm

Re: Universal Transitions

ScoobSTi » September 30th, 2012, 4:04 pm

This is the most beautiful skin I've ever seen!

I'd like to integrate part of this into my Android skin, if you don't mind (with credit of course!).
Image
User avatar
Kaelri
Developer
Posts: 1739
Joined: July 25th, 2009, 4:47 am

Re: Universal Transitions

Kaelri » September 30th, 2012, 4:08 pm

ScoobSTi wrote:This is the most beautiful skin I've ever seen!

I'd like to integrate part of this into my Android skin, if you don't mind (with credit of course!).
Feel free. :) Be aware, though, that it won't work properly on systems with multiple monitors. (The text will stick out into the monitor on the right.)
User avatar
wiedzmawiedzma
Posts: 112
Joined: August 18th, 2012, 5:19 pm

Re: Universal Transitions

wiedzmawiedzma » October 2nd, 2012, 7:44 pm

Here I have to agree with the previous caller skin is great pity that for the time being, you can type one address RSS
Every day I look here or here Kaelri not added a promised a version for more addresses and impatience I bite nails! :great:
User avatar
jsmorley
Developer
Posts: 19467
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Universal Transitions

jsmorley » October 2nd, 2012, 7:49 pm

wiedzmawiedzma wrote:Here I have to agree with the previous caller skin is great pity that for the time being, you can type one address RSS
Every day I look here or here Kaelri not added a promised a version for more addresses and impatience I bite nails! :great:
No good deed goes unpunished.
User avatar
Mordasius
Posts: 1062
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Universal Transitions

Mordasius » October 7th, 2012, 2:23 pm

This is another beauty and the effect is as smooth as silk using "MoveToX" and "MoveToY", however, when I try using "FadeIn" I get the error:

Script: Transition.lua:238: attempt to perform arithmetic on local 'Xi' (a nil value)

The following is an example of a skin that generates this error:

Code: Select all

[Rainmeter]
Update=50
MiddleMouseUpAction=!Refresh

[Variables]
UpdateMultiplier=20

[Transition]
Measure=Script
ScriptFile=Transition.lua

[sMeter]
Meter=String
UpdateDivider=#UpdateMultiplier#
DynamicVariables=1
FontColor=ffffff
SolidColor=0,0,0,1
FontSize=20
StringStyle=Bold
AntiAlias=1

[Line1]
Meter=string
Meterstyle=sMeter
Text="This is line 1"
LeftMouseUpAction=[!HideMeter Line1] [ !CommandMeasure Transition "FadeIn('Line2')"]

[Line2]
Meter=string
Meterstyle=sMeter
Text="..and this is line 2"
LeftMouseUpAction=[!HideMeter Line2] [ !CommandMeasure Transition "FadeIn('Line1')"]
Hidden=1
What am I doing wrong?
User avatar
Kaelri
Developer
Posts: 1739
Joined: July 25th, 2009, 4:47 am

Re: Universal Transitions

Kaelri » October 7th, 2012, 3:01 pm

Lua's "GetOption" doesn't recognize options inherited from MeterStyles right now. So you need to set FontColor individually on both Line1 and Line2. (This is something that annoys the hell out of me, too; we're hoping to fix it in the semi-near future.)
User avatar
Mordasius
Posts: 1062
Joined: January 22nd, 2011, 4:23 pm
Location: GMT +8

Re: Universal Transitions

Mordasius » October 7th, 2012, 3:11 pm

Setting FontColor=255,255,255 or FontColor=ffffff on both [Line1] and [Line2] gets rid of the error but I still don't see [Line2] after clicking on [Line1].
User avatar
Kaelri
Developer
Posts: 1739
Joined: July 25th, 2009, 4:47 am

Re: Universal Transitions

Kaelri » October 7th, 2012, 3:25 pm

Mordasius wrote:Setting FontColor=255,255,255 or FontColor=ffffff on both [Line1] and [Line2] gets rid of the error but I still don't see [Line2] after clicking on [Line1].
Sorry, I had only checked the skin for the cause of the "Xi" error, not other problems. The "Fade" commands in this script only affect the meter's transparency; they do not change the Hidden state. So Line2 remains hidden even while it's "fading in." If I understand what you're trying to accomplish, this should work:

Code: Select all

[Rainmeter]
Update=50
MiddleMouseUpAction=!Refresh

[Variables]
UpdateMultiplier=20

[Transition]
Measure=Script
ScriptFile=Transition.lua

[sMeter]
Meter=String
UpdateDivider=#UpdateMultiplier#
DynamicVariables=1
FontColor=ffffff
SolidColor=0,0,0,1
FontSize=20
StringStyle=Bold
AntiAlias=1

[Line1]
Meter=string
Meterstyle=sMeter
Text="This is line 1"
FontColor=ffffff
LeftMouseUpAction=[!HideMeter Line1] [!ShowMeter Line2] [!CommandMeasure Transition "FadeIn('Line2')"][!CommandMeasure Transition "FadeOut('Line1')"]

[Line2]
Meter=string
Meterstyle=sMeter
Text="..and this is line 2"
FontColor=ffffff00
LeftMouseUpAction=[!HideMeter Line2] [!ShowMeter Line1] [!CommandMeasure Transition "FadeIn('Line1')"][!CommandMeasure Transition "FadeOut('Line2')"]
Hidden=1