It is currently May 8th, 2024, 8:31 pm

can you reference individual padding values?

Get help with creating, editing & fixing problems with skins
dans98
Posts: 5
Joined: October 27th, 2023, 8:01 pm

can you reference individual padding values?

Post by dans98 »

Code: Select all

[MyString]
Meter=String
Text=Hello, world!
padding=11,12,13,14
FontColor=200,150,255,100
X=20
Y=10
W=100
H=50
given the example meter above, I know you can get its X, Y, W, & H setting using like this [MyString:X].

Is it possible to reference an individual padding option by that i mean Left, Top, Right, or Bottom, if so how?
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: can you reference individual padding values?

Post by jsmorley »

dans98 wrote: October 27th, 2023, 10:13 pm

Code: Select all

[MyString]
Meter=String
Text=Hello, world!
padding=11,12,13,14
FontColor=200,150,255,100
X=20
Y=10
W=100
H=50
given the example meter above, I know you can get its X, Y, W, & H setting using like this [MyString:X].

Is it possible to reference an individual padding option by that i mean Left, Top, Right, or Bottom, if so how?
Something like:
padding=#left#,#top#,#right#,#bottom#

Then there are several ways to control the values contained by the [Variables]. Particularly, the action !SetVariable. The current values can be retrieved by referencing the variable as #left# etc. Be sure to use DynamicVariables=1 on any measure or meter you are getting the current value in.
dans98
Posts: 5
Joined: October 27th, 2023, 8:01 pm

Re: can you reference individual padding values?

Post by dans98 »

jsmorley wrote: October 27th, 2023, 11:47 pm Something like:
padding=#left#,#top#,#right#,#bottom#

Then there are several ways to control the values contained by the [Variables]. Particularly, the action !SetVariable. The current values can be retrieved by referencing the variable as #left# etc. Be sure to use DynamicVariables=1 on any measure or meter you are getting the current value in.

That I have done before, I was hoping it was possible to do it without needing to use variables.
User avatar
Yincognito
Rainmeter Sage
Posts: 7211
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: can you reference individual padding values?

Post by Yincognito »

dans98 wrote: October 28th, 2023, 12:07 am That I have done before, I was hoping it was possible to do it without needing to use variables.
Yeah, the section variable parameters list is limited to some key options that are used more frequently (for example, there is no [SomeMeter:Hidden] either). That being said, besides using variables like jsmorley suggested (a quite comfortable method overall), you could use inline Lua to get the value of any option from a measure or meter, via something like (SKIN:GetMeter('SomeMeter')):GetOption('Padding') in this case, then perform some string splitting to get and return individual paddings:
https://docs.rainmeter.net/manual/lua-scripting/
https://docs.rainmeter.net/manual/lua-scripting/inline-lua/
https://stackoverflow.com/questions/19262761/lua-need-to-split-at-comma
I know, it takes some light effort to do it, but it is a possibility nevertheless.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth