It is currently April 24th, 2024, 9:51 am

How do you make a meter relative to the left side of the previous meter?

Get help with creating, editing & fixing problems with skins
RedEagle3
Posts: 2
Joined: December 25th, 2019, 7:03 pm

How do you make a meter relative to the left side of the previous meter?

Post by RedEagle3 »

For example, I have a string meter and want to add a another string meter but I want this meter to appear on the left of the first meter.

x=r This makes the text appear directly in front of the meter before it, I want it to appear directly behind the meter before it.
I thought x=R would would work since this is suppose to reference the left side according to the documentation but that doesn't seem to be working.
User avatar
balala
Rainmeter Sage
Posts: 16164
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How do you make a meter relative to the left side of the previous meter?

Post by balala »

RedEagle3 wrote: December 25th, 2019, 7:09 pm For example, I have a string meter and want to add a another string meter but I want this meter to appear on the left of the first meter.
I hope I didn't misunderstood what you want, but at least if I didn't, here is an approach. Supposing the first meter is named [Meter1] and the second one, which has to be placed on left of the first one, is [Meter2]:

Code: Select all

[Meter1]
...

[Meter2]
...
X=([Meter1:X]-[#CURRENTSECTION#:W])
...
DynamicVariables=1
Note that [Meter1] has to be placed enough on right, otherwise [Meter2] will go outside of the skin to left.
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: How do you make a meter relative to the left side of the previous meter?

Post by Mor3bane »

you can also do X=-40r

but balala's version can be dynamically altered in later code, if necessary. specifically CURRENTSECTION may change and there would be no problems.
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
balala
Rainmeter Sage
Posts: 16164
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How do you make a meter relative to the left side of the previous meter?

Post by balala »

Mor3bane wrote: December 25th, 2019, 8:13 pm you can also do X=-40r
Right, supposing the width of the second meter is exactly 40 pixels. But what if it isn't?
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: How do you make a meter relative to the left side of the previous meter?

Post by Mor3bane »

balala wrote: December 25th, 2019, 8:17 pm Right, supposing the width of the second meter is exactly 40 pixels. But what if it isn't?
break out the calculator. :twisted:
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
balala
Rainmeter Sage
Posts: 16164
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How do you make a meter relative to the left side of the previous meter?

Post by balala »

Mor3bane wrote: December 25th, 2019, 8:22 pm break out the calculator. :twisted:
Extremely smart and especially cheap solution. :thumbup:
But definitely comforting sometimes.
RedEagle3
Posts: 2
Joined: December 25th, 2019, 7:03 pm

Re: How do you make a meter relative to the left side of the previous meter?

Post by RedEagle3 »

balala wrote: December 25th, 2019, 7:37 pm I hope I didn't misunderstood what you want, but at least if I didn't, here is an approach. Supposing the first meter is named [Meter1] and the second one, which has to be placed on left of the first one, is [Meter2]:

Code: Select all

[Meter1]
...

[Meter2]
...
X=([Meter1:X]-[#CURRENTSECTION#:W])
...
DynamicVariables=1
Note that [Meter1] has to be placed enough on right, otherwise [Meter2] will go outside of the skin to left.
That worked perfectly!
Thank you!!!
User avatar
Mor3bane
Posts: 943
Joined: May 7th, 2016, 7:32 am

Re: How do you make a meter relative to the left side of the previous meter?

Post by Mor3bane »

RedEagle3 wrote: December 25th, 2019, 8:28 pm That worked perfectly!
Thank you!!!
VOODOO!!
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself - be amazing at it

The law of averages says what it means; even if you get everything right, you will get something wrong. Therefore; self managing error trapping initiates another set of averages - amongst the errors, some of them will not be errors, instead those instances will appear to be "luck". One cannot complain of the 'appearance' of 'infinite regress of causation', even if it does not have a predictable pattern, only that it requires luck to achieve.
User avatar
balala
Rainmeter Sage
Posts: 16164
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How do you make a meter relative to the left side of the previous meter?

Post by balala »

RedEagle3 wrote: December 25th, 2019, 8:28 pm That worked perfectly!
I'm glad. However take into account that if you know the size of the meters (especially the size of the second meter), Mor3bane's solution is much simpler. Unfortunately in most cases the size of String meters for instance, may vary.
User avatar
pul53dr1v3r
Posts: 442
Joined: July 30th, 2014, 10:30 am

Re: How do you make a meter relative to the left side of the previous meter?

Post by pul53dr1v3r »

balala wrote: December 25th, 2019, 7:37 pm

Code: Select all

[Meter1]
...

[Meter2]
...
X=([Meter1:X]-[#CURRENTSECTION#:W])
...
DynamicVariables=1
if there is #PREVIOUSSECTION# option, it would be much easier to make this especially if we have a lot of the situations where using relative positioning is necessary.

One style meter would be enough for all of them.
But i'm not sure why is it missing in Rainmeter?

[Style1]
X=([#PREVIOUSSECTION#:X]-[#CURRENTSECTION#:W])

[Meter1]
...

[Meter2]
MeterStyle=Style1
...
DynamicVariables=1

[Meter3]
...

[Meter4]
MeterStyle=Style1
...
DynamicVariables=1

etc.