It is currently March 29th, 2024, 8:30 am

How to set the position of an 'Include' from main skin?

Get help with creating, editing & fixing problems with skins
Lylat1an
Posts: 6
Joined: June 15th, 2019, 8:08 pm

How to set the position of an 'Include' from main skin?

Post by Lylat1an »

(I'm new to Rainmeter and this is my first post, I don't know all the proper terms so I apologize in advance for any confusion)

I'm looking to streamline the process of adding multiple steampunk-like gauges to a skin I'm making that shows various loads and temperatures from my system.

I can make the face, rotating needle, and underlying text of each gauge look good from the main .ini, but getting the positioning of everything just right is a pain and I might have up to 20 gauges when I'm finished.

To make the process easier (And have less code to scroll through) I'd like to have each gauge be its own @include, Copy/Pasting the code from one gauge and modifying it to show a different core or component while having all the X and Y values for the face, needle, and text be the same within each gauge's container.

The problem I'm currently facing is that I can't find a way to properly position an @Include for such a gauge. It just parks itself in the upper-left corner.

I can post the code if it will help, but I think I just need to see an example.

Thanks for reading!
User avatar
StArL0rd84
Posts: 424
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: How to set the position of an 'Include' from main skin?

Post by StArL0rd84 »

You are using @include to mesh several files together into being one skin.
So you still need to assign the X and Y for the meters in the included files as if they were still in the same skin config file.

Could do

Main skin:
[Guage1]
X=10
Y=10

Included skin:
[Guage2]
X=120r
Y=r

Guage2 would now appear at same Y but 120 pixels to the right of Guage1.

Might have missunderstood completely, would help if you could post the code...
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to set the position of an 'Include' from main skin?

Post by balala »

StArL0rd84 wrote: June 16th, 2019, 9:00 am would help if you could post the code...
No, don't post the code, I think it' useless. Lylat1an, instead pack the whole content of the config and upload the package.
Lylat1an
Posts: 6
Joined: June 15th, 2019, 8:08 pm

Re: How to set the position of an 'Include' from main skin?

Post by Lylat1an »

Here you go.

I didn't include any plugins so it's not fully functional.
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to set the position of an 'Include' from main skin?

Post by balala »

There is something else you'd also like to include? For now two files should have to be included: Background.inc and CPU1.inc, however the last one isn't because you've doubled the @Include option: you can't have twice such options into one single skin. But you can rename any (or both) of them. For example leave the @Include=Include\Background.inc option as it is, in the [Background] meter and replace the @Include=Include\CPU1.inc option of the [Meter_CPU1] meter with the following one: @IncludeCPU1=Include\CPU1.inc. Note the difference, which is colored red above.
Lylat1an
Posts: 6
Joined: June 15th, 2019, 8:08 pm

Re: How to set the position of an 'Include' from main skin?

Post by Lylat1an »

Okay, I renamed the second @Include to @IncludeCPU1.

However, I still can't get the gauge out of the corner.
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to set the position of an 'Include' from main skin?

Post by balala »

Lylat1an wrote: June 16th, 2019, 7:44 pm However, I still can't get the gauge out of the corner.
Not sure what you mean by "gauge"? It's a meter?
If it is, are you talking about the [Meter_CPUDial1] Image meter, contained into the CPU1.inc file?
Lylat1an
Posts: 6
Joined: June 15th, 2019, 8:08 pm

Re: How to set the position of an 'Include' from main skin?

Post by Lylat1an »

balala wrote: June 16th, 2019, 7:57 pm Not sure what you mean by "gauge"? It's a meter?
If it is, are you talking about the [Meter_CPUDial1] Image meter, contained into the CPU1.inc file?
I'm referring to everything in the CPU1.inc file.

When executed, everything therein looks like a gauge on my screen. I don't know what else to call it. :confused:
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to set the position of an 'Include' from main skin?

Post by balala »

Lylat1an wrote: June 18th, 2019, 1:16 am I'm referring to everything in the CPU1.inc file.

When executed, everything therein looks like a gauge on my screen. I don't know what else to call it. :confused:
Ok, now I understood.
Note that not all meters belonging to CPU1.inc are in the upper left corner of the skin. [Meter_CPUDial1] is, because there are no position options set (the X and Y are commented out, however even if they wouldn't be, they were set to 0, both). If you want to move the meter, add the needed position, as the X and Y options within the [Meter_CPUDial1] meter.
Other meters are placed on different positions. For example [Meter_CPUNeedle1] horizontally is set to X=105, [MeterCPU1Histogram] to X=30 and Y=115 and so on.
However in such cases when the meters are placed one after the other, it's a much better idea to position them relatively to each other. If you do this, if later you want to move the meters contained into the .inc file, you only have to move the first meter, the others will "follow" it (being positioned relatively).
For example rewrite the X and Y options of all meters belonging to the CPU1.inc file, as it follows:

Code: Select all

[Meter_CPUDial1]
...
X=0
Y=0
...

[Meter_CPUNeedle1]
...
X=105r
Y=0r
...

[Meter_Shape]
...
X=-105r
Y=0r
...

[MeterCPU1Histogram]
...
X=30r
Y=115r
...

[MeterCPU1Text]
...
X=75r
Y=105r
...

[MeterCPU1Temp]
...
X=0r
Y=25r
...
Note that all meters starting from the second one are placed relatively to the previous one.
Now you can move all these meters as you want. For this you only have to modify the X=0 and Y=0 options of the [Meter_CPUDial1] Image meter, getting it to desired position. What I suppose you'll want to do is to add X=30 and Y=30, getting it this way "simmetrically" to the second set of meters.