Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 1640

Help: Rainmeter Skins • Re: Color-Slider -> Consultation

$
0
0
But I have a question. How should this be understood? We have not replaced the value of #ScaleX# but we have kept the value of #ScaleX#?
I explained escaped variables to sl23 not long ago but maybe that explanation won't apply here, so, here's another attempt to explain it.

Variables have two syntaxes, #Normal# and [#Nested], and both can be escaped: #*Normal*# and [#*Nested*].

The difference between the normal and nested syntax and escaped is , as explained by Yincognito:
I use:
a) standard #variable# in normal circumstances
b) nested [#variable] when:
- nesting variables within other variables
- needing the value just changed by a bang in the same option
- forcing dynamic behavior in places not supporting dynamic variables
c) escaped #*variable*# when using the value isn't desired yet
d) escaped nested [#*variable*] when:
- nesting escaped variable names
- using nested variable names within other variables in [Variables]
- using multiple escaping levels like [#**variable**] in [Variables]

I don't use the nested syntax everywhere for two reasons:
- performance: it forces dynamic behavior in that section
- clarity: when used it makes clear that it is actually needed
So, in short, in your case, when you use #ScaleX#, you are using the inmediate value of the ScaleX variable, when you use [#*ScaleX*], you are using the #ScaleX# variable directly, which remains dynamic.

A visual way to put it: You're using SetOption bang, which sets the X option in the SliderRed meter, so this:

Code:

[!SetOption SliderRed X "(Clamp(($MouseX$ / #ScaleX#),(135),(175)) * #ScaleX#)"]
equals this:

Code:

[SliderRed]..X = (Clamp((125),(135),(175)) * 1) 
The numbers are as example, not necessarily real values of the variables.

and this:

Code:

[!SetOption SliderRed X "(Clamp(($MouseX$ / #ScaleX#),(135),(175)) * [#*ScaleX*])"]
equals this:

Code:

[SliderRed]..X = (Clamp((125),(135),(175)) * [#ScaleX])
Notice how the ScaleX variable is still the variable, and not its value.

for instance this:

Code:

[!SetOption SliderRed X "(Clamp(($*MouseX*$ / [#*ScaleX*]),(135),(175)) * [#*ScaleX*])"]
equals this:

Code:

[SliderRed]..X=(Clamp(($MouseX$ / [#ScaleX]),(135),(175)) * [#ScaleX])

Statistics: Posted by RicardoTM — Today, 7:38 pm



Viewing all articles
Browse latest Browse all 1640

Trending Articles