Repository navigation
User JSON SpeedometerIndicator
Back to list | Indicator page | Русский
This page describes the JSON template of the speedometer indicator for manual editing of .vttp: which fields exist and which values are allowed.
{
"name": "com.velitask.plagin.official.speedometer",
"data": {
"maket": { "preset": "auto" },
"properties": {
"Distance": {},
"speedScale": { "value": 2 },
"font": {
"name": "Dialog",
"style": 0,
"size": 120,
"color": { "r": 255, "g": 255, "b": 255, "a": 255 }
},
"textTemplate": {
"template": "{curr}",
"vars": { "curr": "%.0f" }
},
"scaleColor": { "r": 255, "g": 255, "b": 255, "a": 255 },
"arrowFillColor": { "r": 204, "g": 88, "b": 84, "a": 255 },
"arrowStrokeColor": { "r": 255, "g": 255, "b": 255, "a": 255 },
"tailColor": { "r": 103, "g": 136, "b": 166, "a": 178 },
"background": {
"color": { "r": 204, "g": 204, "b": 204, "a": 255 },
"transparency": {}
}
}
}
}An empty object {} in transparency means the default value 80; to set your own, use {"value": 80}.
Selects the distance sensor that the speed is taken from. In a template leave it empty: the sensor is picked automatically when the indicator is added to a project.
{
"Distance": {}
}| Field | Values | What it does |
|---|---|---|
sourceId |
{"value": number} |
Identifier of the source in the project. Not specified in a template. |
sensorId |
{"value": number} |
Identifier of the sensor in the source. Not specified in a template. |
The maximum of the speedometer scale.
{
"speedScale": {
"value": 2
}
}| Field | Values | What it does |
|---|---|---|
value |
0, 1, 2, 3
|
Index of the selected scale. |
value |
Scale |
|---|---|
0 |
40 km/h |
1 |
80 km/h |
2 |
160 km/h (default) |
3 |
320 km/h |
The font and color of the number in the center.
{
"font": {
"name": "Dialog",
"style": 0,
"size": 120,
"color": { "r": 255, "g": 255, "b": 255, "a": 255 }
}
}| Field | Values | What it does |
|---|---|---|
name |
string | Font name. |
style |
0, 1, 2
|
Style: 0 plain, 1 bold, 2 italic. |
size |
1..999 |
Font size. |
color.r |
0..255 |
Red channel. |
color.g |
0..255 |
Green channel. |
color.b |
0..255 |
Blue channel. |
color.a |
0..255 |
Opacity: 0 fully transparent, 255 opaque. |
The template of the number in the center. It builds a string from the current speed in km/h.
{
"textTemplate": {
"template": "{curr}",
"vars": {
"curr": "%.0f"
}
}
}| Field | Values | What it does |
|---|---|---|
template |
string | The resulting text with variables in curly braces. |
vars |
object | Formats of the variables. |
| Variable | Default format | What it shows |
|---|---|---|
{curr} |
%.0f |
The current speed in km/h. |
The format is applied to a floating-point number: %.0f is a whole number, %.1f is one decimal place. The integer format %d does not work: the variable will be replaced with an empty string.
The color of the tick marks and the scale numbers.
{
"scaleColor": { "r": 255, "g": 255, "b": 255, "a": 255 }
}| Field | Values | What it does |
|---|---|---|
r |
0..255 |
Red channel. |
g |
0..255 |
Green channel. |
b |
0..255 |
Blue channel. |
a |
0..255 |
Opacity: 0 fully transparent, 255 opaque. |
The fill of the needle.
{
"arrowFillColor": { "r": 204, "g": 88, "b": 84, "a": 255 }
}| Field | Values | What it does |
|---|---|---|
r |
0..255 |
Red channel. |
g |
0..255 |
Green channel. |
b |
0..255 |
Blue channel. |
a |
0..255 |
Opacity: 0 fully transparent, 255 opaque. |
The color of the needle outline and the central dot.
{
"arrowStrokeColor": { "r": 255, "g": 255, "b": 255, "a": 255 }
}| Field | Values | What it does |
|---|---|---|
r |
0..255 |
Red channel. |
g |
0..255 |
Green channel. |
b |
0..255 |
Blue channel. |
a |
0..255 |
Opacity: 0 fully transparent, 255 opaque. |
The color of the "tail", the sector that is painted behind the needle.
{
"tailColor": { "r": 103, "g": 136, "b": 166, "a": 178 }
}| Field | Values | What it does |
|---|---|---|
r |
0..255 |
Red channel. |
g |
0..255 |
Green channel. |
b |
0..255 |
Blue channel. |
a |
0..255 |
Opacity: 0 fully transparent, 255 opaque. |
The color of the circle under the scale and its transparency.
{
"background": {
"color": { "r": 204, "g": 204, "b": 204, "a": 255 },
"transparency": { "value": 80 }
}
}| Field | Values | What it does |
|---|---|---|
color.r |
0..255 |
Red channel. |
color.g |
0..255 |
Green channel. |
color.b |
0..255 |
Blue channel. |
color.a |
0..255 |
Opacity of the color itself: 0 fully transparent, 255 opaque. |
transparency.value |
0..100 |
Background transparency in percent: 0 opaque, 100 fully transparent. The default is 80. An empty object {} means the default value 80; to set your own, use {"value": 80}. |