# 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
```

{% hint style="info" %}
Keep in mind that key values in the meter section **always** override any MeterStyles.&#x20;
{% endhint %}

More info of part of this code:\
[Dynamic & Reactive user interface](/coding-a-module/dynamic-and-reactive-user-interface.md#scaling) [Dynamic & Reactive user interface](/coding-a-module/dynamic-and-reactive-user-interface.md#center) [Dynamic & Reactive user interface](/coding-a-module/dynamic-and-reactive-user-interface.md#mouseactions) [Code formatting](/coding-a-module/code-formatting.md#meter-and-measure-naming)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.jaxcore.app/coding-a-module/meterstyles.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
