It is currently April 27th, 2024, 6:15 am

Round the edges of a roundline

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16174
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Round the edges of a roundline

Post by balala »

Rafamear wrote: September 11th, 2023, 8:38 pm I wanted to know if there is any way to calculate the width of a text on the screen, just like I want to do here where a line will have its width according to the size of the text.
Yep, there is. The [Clock:W] section variable is returning the length (width as W) of the string meter.
Rafamear
Posts: 114
Joined: November 15th, 2021, 1:47 am
Location: Brazil

Re: Round the edges of a roundline

Post by Rafamear »

balala wrote: September 11th, 2023, 8:47 pm Yep, there is. The [Clock:W] section variable is returning the length (width as W) of the string meter.
Now it only matches the w I put in, I want the width to be justified to the size of the text on the screen

It looks like this now:

Image

Code: Select all

[Clock]
Meter=String
MeasureName=MeasureTime
X=245
Y=38
FontSize=40
FontFace=#FONT#
AntiAlias=1
FontColor=#COLOR2#
StringAlign=CenterCenter
Text="%1"
W=120

[LineClock]
Meter=Shape
Shape=Rectangle 0,0,[Clock:W],8,4 | Extend HolderFill | Extend HolderStroke 
HolderFill=Fill Color #COLOR2#
HolderStroke=Stroke Color 0,0,0,1
X=170
Y=60
;===========================================Rafamear=================================================
;========================= :welcome: ========== My DeviantArt ========== :Whistle ==============================
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Round the edges of a roundline

Post by Yincognito »

Rafamear wrote: September 11th, 2023, 8:38 pm Oh and one more thing, I'm going to ask here, I wanted to know if there is any way to calculate the width of a text on the screen, just like I want to do here where a line will have its width according to the size of the text.

I wanted to do this because some fonts that I place change in width on the screen and the line becomes smaller or larger in relation to the text

Image
and I'm using the rectangle shape because it fits better with what I was intending

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[Metadata]
Name=Mimali
Author=Rafamear
Version=1.0
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0

[Variables]
@include=#@#Variables.inc

;======================Measures=====================
;===================================================
[MeasureTime]
Measure=Time
Format=%H:%M

[MeasureDate]
Measure=Time
Format=%A, %b %d
FormatLocale=#Lang#

[TranslucentSkin]
Measure=Plugin
Plugin=TranslucentRM
Type=4
Corner=2
BorderColor=ffffff1A

;=======================Shapes======================
;===================================================
[BackgroundBlur]
Meter=Shape
Shape=Rectangle 0,0,330,160,4 | Extend HolderFill | Extend HolderStroke 
HolderFill=Fill Color 245,245,245,25 
HolderStroke=Stroke Color 0,0,0,1
X=0
Y=0

[Clock]
Meter=String
MeasureName=MeasureTime
X=245
Y=38
FontSize=40
FontFace=#FONT#
AntiAlias=1
FontColor=#COLOR2#
StringAlign=CenterCenter
Text="%1"

[LineClock]
Meter=Shape
Shape=Rectangle 0,0,150,8,4 | Extend HolderFill | Extend HolderStroke 
HolderFill=Fill Color #COLOR2#
HolderStroke=Stroke Color 0,0,0,1
X=170
Y=60
Use the appropriate X, Y, W and H parameters of the Clock meter:
https://docs.rainmeter.net/manual/variables/section-variables/
in the position of the LineClock meter or the parameters of the Rectangle. For example:

[LineClock]
...
X=([Clock:X]-[Clock:W]/2)
...

to place LineClock at the same horizontal position as the Clock meter. Subtracting half the Clock width here is because the Clock text is centered on its X.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Round the edges of a roundline

Post by Yincognito »

Rafamear wrote: September 11th, 2023, 9:05 pm Now it only matches the w I put in, I want the width to be justified to the size of the text on the screen

It looks like this now:

Image

Code: Select all

[Clock]
Meter=String
MeasureName=MeasureTime
X=245
Y=38
FontSize=40
FontFace=#FONT#
AntiAlias=1
FontColor=#COLOR2#
StringAlign=CenterCenter
Text="%1"
W=120

[LineClock]
Meter=Shape
Shape=Rectangle 0,0,[Clock:W],8,4 | Extend HolderFill | Extend HolderStroke 
HolderFill=Fill Color #COLOR2#
HolderStroke=Stroke Color 0,0,0,1
X=170
Y=60
Adding DynamicVariables=1 to LineClock might help.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
Rafamear
Posts: 114
Joined: November 15th, 2021, 1:47 am
Location: Brazil

Re: Round the edges of a roundline

Post by Rafamear »

Yincognito wrote: September 11th, 2023, 9:26 pm Adding DynamicVariables=1 to LineClock might help.
It's working as expected, thx y'all
;===========================================Rafamear=================================================
;========================= :welcome: ========== My DeviantArt ========== :Whistle ==============================
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Round the edges of a roundline

Post by Yincognito »

Rafamear wrote: September 11th, 2023, 10:17 pm It's working as expected, thx y'all
Excellent! :great:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16174
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Round the edges of a roundline

Post by balala »

Rafamear wrote: September 11th, 2023, 9:05 pm Now it only matches the w I put in, I want the width to be justified to the size of the text on the screen

It looks like this now:
I understand Yincognito has solved your request, however I wonder now why do you want to create a Shape meter to underline the time. Wouldn't be easier to apply the underline directly to the String meter? In such a case there is no problem on how the length of the underline should be.
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Round the edges of a roundline

Post by Yincognito »

balala wrote: September 12th, 2023, 12:14 pm Wouldn't be easier to apply the underline directly to the String meter? In such a case there is no problem on how the length of the underline should be.
There's a catch here though. Underlining the text is not available as a specific option in the String meter, it has to be added somewhat indirectly via the lesser known inline settings. This might explain why it wasn't applied in this case... :???:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16174
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Round the edges of a roundline

Post by balala »

Yincognito wrote: September 12th, 2023, 1:25 pm Underlining the text is not available as a specific option in the String meter, it has to be added somewhat indirectly via the lesser known inline settings. This might explain why it wasn't applied in this case... :???:
Right. But it's easy to be done, by adding a InlineSetting=Underline option to the String meter.
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Round the edges of a roundline

Post by Yincognito »

balala wrote: September 12th, 2023, 2:29 pm Right. But it's easy to be done, by adding a InlineSetting=Underline option to the String meter.
Indeed. Not sure it will have rounded corners though, despite the fact that the font does have a rounded appearance. Might be another reason why the OP chose the Shape variant here.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth