Skip to content

User JSON SpeedTextIndicator

roosit edited this page Nov 15, 2026 · 2 revisions

Speed Text JSON

Back to list | Indicator page | Русский

Purpose

This page describes the JSON template of the speedText indicator for manual editing of .vttp: which fields exist and which values are allowed.

Full Template

{
  "name": "com.velitask.plagin.official.speedText",
  "data": {
    "maket": { "preset": "auto" },
    "properties": {
      "Speed": {},
      "Distance": {},
      "font": {
        "name": "Dialog",
        "style": 0,
        "size": 48,
        "color": { "r": 255, "g": 255, "b": 255, "a": 255 }
      },
      "textAlign": { "value": 4 },
      "measurement": {
        "system": { "value": 0 },
        "format": { "value": 0 },
        "speed": { "value": "KMH" }
      },
      "textTemplate": {
        "template": "{currNum} {currUnit}",
        "vars": {
          "currNum": "%.1f",
          "currUnit": "%s"
        }
      }
    }
  }
}

Settings

Speed

Selects the speed sensor. Leave it empty in a template: the sensor is picked automatically when the indicator is added to a project.

{
  "Speed": {}
}
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.

Distance

The fallback distance sensor ("Distance"): the speed is taken from it if no speed sensor is selected. Leave it empty in a template: 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.

font

The font and color of the text.

{
  "font": {
    "name": "Dialog",
    "style": 0,
    "size": 48,
    "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.

textAlign

The position of the text inside the layer.

{
  "textAlign": {
    "value": 4
  }
}
Field Values What it does
value 0..8 Index of the text position.
value Position
0 top left
1 top center
2 top right
3 middle left
4 center (default)
5 middle right
6 bottom left
7 bottom center
8 bottom right

measurement

The measurement system, the format of the unit caption and the speed unit ("Units").

{
  "measurement": {
    "system": { "value": 0 },
    "format": { "value": 0 },
    "speed": { "value": "KMH" }
  }
}
Field Values What it does
system.value 0..4 Measurement system.
format.value 0..3 Format of the unit caption.
speed.value KMH, MPS, MPH, KNOTS, FPS Speed unit.
system.value System
0 From global settings (default)
1 Metric
2 Imperial
3 Nautical
4 Mixed
format.value Caption format
0 Full
1 Normal
2 Short
3 Symbol
speed.value Unit
KMH kilometers per hour
MPS meters per second
MPH miles per hour
KNOTS knots
FPS feet per second

The allowed units depend on the system: metric allows KMH, MPS; imperial allows MPH, FPS; nautical allows KNOTS, MPS; mixed allows any of the five. With system 0 the speed field is not used: the unit is taken from the general application settings. If you set speed together with system 1-3, pick a unit from the list of that system; if the unit is not from the list, the system switches to "Mixed".

textTemplate

A string that is built from the current speed.

{
  "textTemplate": {
    "template": "{currNum} {currUnit}",
    "vars": {
      "currNum": "%.1f",
      "currUnit": "%s"
    }
  }
}
Field Values What it does
template string The resulting text with variables in curly braces.
vars object Formats of the variables.

Template variables

Variable Default format What it shows
{currNum} %.1f The current speed, already converted to the selected unit.
{currUnit} %s The caption of the speed unit for {currNum}.

For {currNum}, the format is applied to a floating-point number: %.1f, %.0f, %.2f, etc. are allowed. The %d format does not work: the variable will be replaced with an empty string. For {currUnit}, use %s.

The "Compact" skin replaces template with {currNum}{currUnit}; the formats do not change.

Clone this wiki locally