MeterStyles

MeterStyle are base settings that can be applied to meters, to avoid repetitive settings

String:Style

Should be applied to all string meters

[String:S]
AntiAlias=1
FontSize=(12*#Scale#)
FontFace=#Font#
FontWeight=400
FontColor=#Text_Color#
SolidColor=0,0,0,1            ; to allow better click detection

Creating a MeterStyle

Sometimes, you may come across situations where you'll need multiple meters with same relative positional values but a few different options

You can make use of #CURRENTSECTION# to reduce the amount of code needed to edit for each meter section.

The most common type of situation is when you need to have multiple buttons next to each other.

[Button.Shape:S]
X=((150/2+20)*#Scale#)r
Y=(-40/2*#Scale#)r
Shape=Rectangle 0,0,150,40,5 | StrokeWidth 0 | Scale #Scale#,#Scale#,0,0 | Extend Fill
Fill=Fill Color #Sec_Color#
MouseOverAction=[!SetOption #CURRENTSECTION# Fill "Fill Color #Ter_Color#"][!UpdateMeter #CURRENTSECTION#][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# Fill "Fill Color #Sec_Color#"][!UpdateMeter #CURRENTSECTION#][!Redraw]
; We used #CURRENTSECTION# here so we don't have to enter the section names each time
[Button.String:S]
FontSize=(15*#Scale#)
StringAlign=CenterCenter
X=(150/2*#Scale#)r
Y=(40/2*#Scale#)r

[Button.Shape.1]
Meter=Shape
X=0                        ; append the initial positional values for the first button
Y=0
MeterStyle=Button.Shape:S
[Button.String.1]
Meter=String
MeterStyle=String:S | Button.String:S        ; apply both meter styles
[Button.Shape.2]
Meter=Shape
MeterStyle=Button.Shape:S
[Button.String.2]
Meter=String
MeterStyle=String:S | Button.String:S

Keep in mind that key values in the meter section always override any MeterStyles.

Last updated