It is currently March 28th, 2024, 3:41 pm

Need help with StringAlign...

General topics related to Rainmeter.
Post Reply
Vikerules
Posts: 3
Joined: May 2nd, 2017, 7:32 am

Need help with StringAlign...

Post by Vikerules »

I want the time to be moved to the right but when i use StringAlign=Right the time just disappears

Image

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1


[Metadata]
Name=Lock Clock
Information=Clock that looks like the Windows 10 lock screen. Suited for 1080p screens.
Author=5×µ²³#5096 /u/DEFAULTUSER_
Version=1.0
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0



[Variables]
Scale=1
color=ffffff

[MTime]
Measure=Time
Format=%#H∶%M

[MDate]
Measure=Time
Format=%A, %e %B

[Time]
Meter=String
MeasureName=MTime
InlineSetting=Face | Segoe UI
InlineSetting2=Color | #color#
InlineSetting3=Weight | 300
InlineSetting4=Size | (95 * #scale#)
AntiAlias=1
SolidColor=0,0,0,1


[Date]
Meter=String
MeasureName=MDate
Y=(- 20 * #Scale#)R
InlineSetting=Face | Segoe UI
InlineSetting2=Color | #color#
InlineSetting3=Weight | 300
InlineSetting4=Size | (42 * #scale#)
InlineSetting5=CharacterSpacing | 0 | 0.599
AntiAlias=1
SolidColor=0,0,0,1
DynamicVariables=1
Last edited by jsmorley on January 9th, 2018, 12:31 am, edited 1 time in total.
Reason: Added [code] [/code] tags
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Need help with StringAlign...

Post by jsmorley »

In order to have them both line up on the right, you will need to StringAlign=Right on both...

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

[Metadata]
Name=Lock Clock
Information=Clock that looks like the Windows 10 lock screen. Suited for 1080p screens.
Author=5×µ²³#5096 /u/DEFAULTUSER_
Version=1.0
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0

[Variables]
Scale=1
color=ffffff

[MTime]
Measure=Time
Format=%#H∶%M

[MDate]
Measure=Time
Format=%A, %#d %B

[Time]
Meter=String
MeasureName=MTime
X=530
StringAlign=Right
InlineSetting=Face | Segoe UI
InlineSetting2=Color | #color#
InlineSetting3=Weight | 300
InlineSetting4=Size | (95 * #scale#)
AntiAlias=1
SolidColor=0,0,0,1

[Date]
Meter=String
MeasureName=MDate
X=530
StringAlign=Right
Y=(- 20 * #Scale#)R
InlineSetting=Face | Segoe UI
InlineSetting2=Color | #color#
InlineSetting3=Weight | 300
InlineSetting4=Size | (42 * #scale#)
InlineSetting5=CharacterSpacing | 0 | 0.599
AntiAlias=1
SolidColor=0,0,0,1
DynamicVariables=1
1.png
The key to StringAlign in general is the X (and possibly Y) position of the meter. That is the "anchor" that the StringAlign uses.

https://docs.rainmeter.net/manual/meters/string/#StringAlign

Just be sure the X is large enough that the longest possible string value for the meter will fit (or wrap it with CiipString=2) and then StringAlign=Right will "start" it at that point and in a sense draw backwards to the left.

If you don't set the X value, and use StringAlign=Right, it will "start" at zero and draw backwards to the left, into an alternative universe... Confusing for evil Spock, and useless for you.

P.S. I changed the time code for "day of month" from %e to %#d. I don't find %e to be particularly useful, as although it avoids the leading zero of %d, it adds a leading space instead, which is just as annoying. If you use the # character with %d, as in %#d, it will automatically strip off any leading zeros as needed, and you don't get weird gaps.
Post Reply