Quantcast
Viewing all articles
Browse latest Browse all 899

Calculating the text width

Hi everyone

Unfortunately I don't really know what to do here. I would calculate the string width, so to speak. If the string is longer than my skin of 300, the skin should be enlarged by the length of the text (red line). The minimum width of the skin is always 300, it should only expand by the size of the text. Since the text is sometimes longer or shorter by chance.
The Calculation is not 100 percent right.

Thanks for helping Image may be NSFW.
Clik here to view.
:rosegift:
Image may be NSFW.
Clik here to view.
:givelove:


SKin-Code:

Code:

[Rainmeter]Update=1000AccurateText=1DynamicWindowSize=1[Variables]TestString=This is an test String should be over 300px[Background]Meter=ShapeShape=Rectangle 0,0,300,150,10 | Fill Color 0,0,0,150 | StrokeWidth 2 | Stroke Color 0,0,0,140AntiAlias=1DynamicVariables=1;-----------------------------------------------Measures----;--------------------------------------------[MeasureString]Measure=StringString=#TestString#RegExpSubstitute=1Substitute="(.)":"0","^(.)":"1"DynamicVariables=1UpdateDivender=-1[MeasureLength]Measure=CalcFormula=( 1 + Log ( [MeasureString] ))Substitute="inf":"too many"DynamicVariables=1UpdateDivender=-1[MeasureSize]Measure=CalcFormula=( 1600 / [MeasureLength] )DynamicVariables=1UpdateDivender=-1;--------------------------------------------; ------ Meters -------;--------------------------------------------[ViewTestString]Meter=StringFontSize=12FontColor=255,255,255,255X=5Y=50Text=#TestString#DynamicVariables=1[MeterImage2]Meter=ImageSolidColor=255,255,255,255X=5Y=70W=((7.3*[MeasureLength]))H=10DynamicVariables=1[MeterImageTest]Meter=ImageSolidColor=255,0,0,255X=(5+[MeterImage2:W])Y=80W=(295-(7.3*[MeasureLength]))H=10DynamicVariables=1
Screenshot 2025-02-09 191721.png

Statistics: Posted by Rooky_89 — Yesterday, 5:20 pm — Replies 18 — Views 251



Viewing all articles
Browse latest Browse all 899

Trending Articles