It is currently December 15th, 2019, 6:23 am

Text Alignment

Help with creating, editing & fixing problems with skins
ItsJustRyan
Posts: 37
Joined: October 25th, 2019, 1:20 am

Text Alignment

ItsJustRyan » November 9th, 2019, 6:45 am

Hi!

At the moment I'm trying to make a circular meter that displays the volume. Currently everything works except for a string meter in the center that displays the actual value. Basically, when its at any 2 digit value its ok,but when its 1 or 3 digits its no longer centered and i tried to use the string alin thing to n avail. Helps pls?

Code: Select all

[Rainmeter]
Update=1

[Metadata]
Author=Ryan

[Variables]
TotalColor=173,230,224,255
FreeColor=75,171,161,255
UsedColor=FF8800

[mVolume]
 Measure=Plugin
 Plugin=Win7AudioPlugin

[mVolume2]
 Measure=Calc
 Formula=mVolume
 IfCondition=(mVolume2 = -1)||(mVolume2 = 0)
 IfTrueAction=[!SetOption "Text2.Volume" "Text" "Muted"][!Update]
 IfFalseAction=[!SetOption "Text2.Volume" "Text" "%1%"][!Update]


[MeterVol]
Meter=Roundline
MeasureName=mVolume
X=10
Y=0
W=120
H=120
StartAngle=-4.712
RotationAngle=6.283
LineLength=20
LineColor=#UsedColor#
Solid=1
AntiAlias=1
MouseScrollDownAction=[!CommandMeasure "mVolume" "ChangeVolume -5"][!Update]
MouseScrollUpAction=[!CommandMeasure "mVolume" "ChangeVolume +5"][!Update]

[MeterEllipse]
Meter=Shape
Shape=Ellipse 70,60,16 | Stroke Color 255,255,255,0

[Perc]
Meter=String
MeasureName=mVolume2
x=61
y=49
FontFace=Century Gothic
FontWeight=500
FontColor=#UsedColor#
Text=%1
FontSize=12
AntiAlias=1
SolidColor=0,0,0,200
Last edited by Brian on November 9th, 2019, 7:12 am, edited 1 time in total.
Reason: Please use [code] tags.
User avatar
ikarus1969
Posts: 351
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: Text Alignment

ikarus1969 » November 9th, 2019, 6:58 am

you can add a StringAlign=CENTER to the PERC-meter so its value is centered at the X/Y-Position.
Then change the X and Y-coordinates from the PERC-meter to the center of the circle:

Code: Select all

X=70
Y=60
So the value of the PERC-meter, no matter if 1 digit or 2-digits (or any other value), is always centered at the middle of the circle
mak_kawa
Posts: 371
Joined: December 30th, 2015, 9:47 am

Re: Text Alignment

mak_kawa » November 9th, 2019, 7:15 am

As ikarus1969 said, StringAlign=Center centers the meter string. For example, following test code works.

Code: Select all

[Rainmeter]
Update=1000

[Variables]
UsedColor=FF8800

[mVolume]
Measure=Calc
;Formula=5
Formula=50
;Formula=100

[MeterVol]
Meter=Roundline
MeasureName=mVolume
X=10
Y=0
W=120
H=120
StartAngle=-4.712
RotationAngle=6.283
LineLength=20
LineColor=#UsedColor#
Solid=1
AntiAlias=1

[MeterEllipse]
Meter=Shape
Shape=Ellipse 70,60,16 | Stroke Color 255,255,255,0

[Perc]
Meter=String
MeasureName=mVolume
x=70
y=49
StringAlign=Center
FontFace=Century Gothic
FontWeight=500
FontColor=#UsedColor#
Text=%1
FontSize=12
AntiAlias=1
SolidColor=0,0,0,200
Untitled.png
You do not have the required permissions to view the files attached to this post.
ItsJustRyan
Posts: 37
Joined: October 25th, 2019, 1:20 am

Re: Text Alignment

ItsJustRyan » November 9th, 2019, 7:25 am

Thanks!

These helped a lot :)
User avatar
balala
Rainmeter Sage
Posts: 9267
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Text Alignment

balala » November 9th, 2019, 7:41 am

ikarus1969 wrote:
November 9th, 2019, 6:58 am
you can add a StringAlign=CENTER to the PERC-meter so its value is centered at the X/Y-Position.
Then change the X and Y-coordinates from the PERC-meter to the center of the circle:

Code: Select all

X=70
Y=60
If you set the X and Y options of the [Perc] meter to the posted values, instead of StringAlign=CENTER I'd use StringAlign=CENTERCENTER, to get the value aligned both horizontally and vertically to the center of the Roundline meter:
  • With StringAlign=CENTER:
    Center.png
  • With StringAlign=CENTERCENTER:
    CenterCenter.png
You do not have the required permissions to view the files attached to this post.