It is currently September 29th, 2024, 5:30 pm

Continuous string

General topics related to Rainmeter.
John_Smith
Posts: 2
Joined: October 25th, 2013, 7:48 pm

Continuous string

Post by John_Smith »

Hi guys, simple question here. Sorry to bother, but I couldn't find solution in FAQ and my programming skills are below average. I'm editing one of my old configs, what have is simple one-line info kinda like CPU 30% RAM% THU, 17 OCT 10:20 PM. It has 2 labels for CPU and RAM and 4 meters for CPU/RAM percentage and another two for time and date. Each of them placed on certain X axis value, like X=10 for CPU and X=40 for RAM.
What I want to create is the same end result CPU 30% RAM% THU, 17 OCT 10:20 PM but instead of having fixed X value for every meter and label I want it to start each new meter/label right where previous was ended plus several pixels for space. For instance if my CPU show 11% then I want RAM label start right after percentage% character + several pixels i.e. CPU 11% RAM....
I'm not sure how to achieve this and appreciate any help.

My current code:

Code: Select all

[Rainmeter]
Update=1000

[Variables]
update.Spd=60
FontColor1=224, 224, 224
FontColor2=245, 67, 19
FontName=droidsans
FontHeight=11

[MeasureCPU]
Measure=CPU

[MeasureRAM]
Measure=PhysicalMemory

[MeasureDate]
Measure=Time
Format="%a, %d %b"

[MeasureTime]
Measure=Time
Format="%I:%M %p"

[Background]
Meter=IMAGE
X=11
Y=0
ImageName=bar.png

[LabelCPU]
Meter=STRING
X=10
Y=1
FontColor=#FontColor1#
FontFace=#FontName#
FontSize=#FontHeight#
Text="CPU"
AntiAlias=#AntiAlias#

[MeterCPU]
Meter=STRING
MeasureName=MeasureCPU
X=26r
Y=0r
FontColor=#FontColor2#
FontFace=#FontName#
FontSize=#FontHeight#
AntiAlias=#AntiAlias#
Text="%1%"
NumOfDecimals=0
StringAlign=Center

[LabelRAM]
Meter=STRING
X=47
Y=1
FontColor=#FontColor1#
FontFace=#FontName#
FontSize=#FontHeight#
Text="RAM"
AntiAlias=#AntiAlias#

[MeterRAM]
Meter=STRING
MeasureName=MeasureRAM
X=27r
Y=0r
FontColor=#FontColor2#
FontFace=#FontName#
FontSize=#FontHeight#
Text="%1%"
Percentual=1
AntiAlias=#AntiAlias#
StringAlign=Center

[LabelDate]
MeasureName=MeasureDate
Meter=STRING
X=84
Y=1
FontColor=#FontColor1#
FontFace=#FontName#
FontSize=#FontHeight#
AntiAlias=#AntiAlias#

[MeterTime]
MeasureName=MeasureTime
Meter=STRING
X=49r
Y=0r
FontColor=#FontColor2#
FontFace=#FontName#
FontSize=#FontHeight#
AntiAlias=#AntiAlias#
StringAlign=Left

Last edited by John_Smith on October 29th, 2013, 4:17 pm, edited 1 time in total.
User avatar
jsmorley
Developer
Posts: 22790
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Continuous string

Post by jsmorley »

Use the AccurateText=1 option in the [Rainmeter] section of your skin, then on the meters you want next to each other, use the "R" postfix on the X option for the meters to make them "relative" to the preceding meter.

http://docs.rainmeter.net/manual/meters/general-options#XY

Code: Select all

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

[MeterOne]
Meter=String
FontSize=12
FontColor=255,255,255,255
AntiAlias=1
Text=Hello

[MeterTwo]
Meter=String
X=4R
FontSize=12
FontColor=255,255,255,255
AntiAlias=1
Text=World
10-25-2013 4-47-07 PM.jpg
You do not have the required permissions to view the files attached to this post.
John_Smith
Posts: 2
Joined: October 25th, 2013, 7:48 pm

Re: Continuous string

Post by John_Smith »

Thank you very much for your help, works awesome!

By the way, is it possible to align whole text to the opposite right sight or to the middle? I've tried adding "StringAlign=Center" to the first meter, but it's affecting only this first meter.