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

Help: Rainmeter Skins • Re: Calculating the text width

$
0
0
An example of DynamicWindowSize is:

Code:

[Rainmeter]Update=1000AccurateText=1;DynamicWindowSize=1[MeasureWebParser]Measure=WebParserURL=file://#CURRENTPATH#Test.htmlRegExp=(?siU)<item>(.*)</item>StringIndex=1UpdateRate=20[MeterString]Meter=StringMeasureName=MeasureWebParserFontColor=255,255,255,255FontSize=15SolidColor=0,0,0,1AntiAlias=1
Test.html:

Code:

<item>Some Text</item>

Run that, and it will display nothing. The string value of MeasureWebParser that is used by the string meter is empty on the first update, and without DynamicWindowSize=1, the skin will never grow to accommodate the string value when it is returned.

Uncomment DynamicWindowSize, and run it. You will find that it will update the width and height of the skin to accommodate "Some Text", and if you change the contents of Test.html, the skin will grow AND shrink to fit the string.

Now, as was stated, that doesn't mean you can't SET the size of a meter, or even the skin, as you wish at any time you wish:

Code:

[Rainmeter]Update=1000AccurateText=1;DynamicWindowSize=1[MeasureWebParser]Measure=WebParserURL=file://#CURRENTPATH#Test.htmlRegExp=(?siU)<item>(.*)</item>StringIndex=1UpdateRate=20[MeterString]Meter=StringW=300H=20MeasureName=MeasureWebParserFontColor=255,255,255,255FontSize=15SolidColor=0,0,0,1AntiAlias=1
Run that, and the skin will grow to accommodate the W=300 / H=20 options on the string meter. What it WON'T do is automatically grow or shrink to accommodate longer or shorter strings being changed in Test.html.

Statistics: Posted by jsmorley — Yesterday, 9:58 pm



Viewing all articles
Browse latest Browse all 1489

Trending Articles