It is currently April 27th, 2024, 9:56 pm

Layer concept

Report bugs with the Rainmeter application and suggest features.
Unight
Posts: 19
Joined: November 20th, 2012, 5:12 am

Layer concept

Post by Unight »

Sometimes we want to make a skin, we set a similar layer region will our meter bind to this layer,the meter's region which beyond the layer will not be displayed and Area will only show in the layer within the scope of ,for instance the layer may be of a special type called layer type METER.

[layerdemo]
Meter=layer
W=100
H=100

[imagedemo]
Meter=image
Layername= layerdemo ; Here we will add imagedemo in layerdemo
imagename=”….”
…..
If the image size is 200 * 200 then only display the image area of ​​100 * 100 size calculated from the upper-left corner.
New version of rainmeter offer wheel action. Then we can use wheel action to enhance the experience of the skin effect, such as:

[layerdemo]
Meter=layer
W=100
H=100

[imagedemo]
Meter=image
Layername= layerdemo
imagename=”….”
MouseScrollUpAction=[!setoption imagedemo y ([imagedemo:y]-10)]
MouseScrollDownAction=[!setoption imagedemo y ([imagedemo:y]+10)]
Dynamicvariables=1
…….
Then we the Click imagedemo mouse focus wheel to control the original picture shows, such as wheel to scroll up so imagedemo y coordinates is reduced, the entire meter move up, due to the of this meter of slave and layerdemo layer, then the image only displays the coordinates (0,10) to (100,110), this area of ​​the image.

Above is suitable for high and wide to determine the meter, but the String type of meter if you want to complete the multi-line display text is not an easy thing, if we define w, after setting clipstring = 1, so that is not valid, because We did not set h, h is bad accurate calculation, it is not possible to string type or all meter design a new options such as maxwidth (to similar tooltipwidth), such as:

[stringdemo]
Meter=string
Maxwidth=100
Text=”….”
….
Text width exceeds 100 will automatically wrap, so we do not have to define the width and height of the meter, but this way it is to complete the deserved wide and high, then we can achieve scrolling text effect, this is a lot of people are trying to achieve an effect.

Additional layers of features can be expanded such as may be provided under this layer in the layer inside the meter will be the basis of positioning, such as:

[layerdemo]
Meter=layer
Absolute=1 ;This option enables the function of the layer relative positioning
W=100
H=100

[imgdemo]
Meter=image
Layername= layerdemo
Imagename=”…”
X=40
Y=40

The then imgdemo will be upper-left corner of relative layer layerdemo the offset 40 * 40 pixels.

Or we can additionally set a coordinate representation:
[layerdemo]
Meter=layer
W=100
H=100

[imgdemo]
Meter=image
Layername= layerdemo
Imagename=”…”
X=40l
Y=40l
The then imgdemo will be upper-left corner of relative layer layerdemo the offset 40 * 40 pixels.
In addition, we may also be able to set multiple nested or more ...