Skip to content

User JSON DistanceTextIndicator

roosit edited this page May 15, 2026 · 4 revisions

Distance Text JSON

Back to list | Indicator page | Russian

Purpose

This page describes the JSON template for the distanceText indicator for manual .vttp editing.

Full Template

{
  "name": "com.velitask.plagin.official.distanceText",
  "data": {
    "maket": { "preset": "auto" },
    "properties": {
      "Distance": {},
      "textAlign": {"value":0},
      "valueText": {"name":"Dialog","style":{"value":0},"size":{"value":48},"color":{"r":255,"g":255,"b":255,"a":255}},
      "unitFont": {"name":"Dialog","style":{"value":0},"size":{"value":28}},
      "measurement": {"system":{"value":0},"unit":{"value":0},"format":{"value":0}},
      "textTemplate": {"template":"{currNum} {currUnit} of {fullNum} {fullUnit}","vars":{"currNum":"%.2f","currUnit":"%s","fullNum":"%.0f","fullUnit":"%s"}}
    }
  }
}

Settings

Distance

Selects the distance sensor.

{
  "Distance": {}
}
Field Values What it does
sourceId source id in the project In a real Mixel, selects the data source. It may be omitted in a template.
sensorId sensor id in the source In a real Mixel, selects the concrete sensor. It may be omitted in a template.

textAlign

Aligns text inside the layer.

{
  "textAlign": {"value":0}
}
Field Values What it does
value or nested fields depends on the setting type Stores the setting value.

valueText

Changes the number font.

{
  "valueText": {"name":"Dialog","style":{"value":0},"size":{"value":48},"color":{"r":255,"g":255,"b":255,"a":255}}
}
Field Values What it does
value or nested fields depends on the setting type Stores the setting value.

unitFont

Changes the measurement unit font.

{
  "unitFont": {"name":"Dialog","style":{"value":0},"size":{"value":28}}
}
Field Values What it does
value or nested fields depends on the setting type Stores the setting value.

measurement

Selects measurement system, unit, and unit label format.

{
  "measurement": {"system":{"value":0},"unit":{"value":0},"format":{"value":0}}
}
Field Values What it does
value or nested fields depends on the setting type Stores the setting value.

textTemplate

Defines the distance text. The template can show current distance, total distance, and their measurement units.

{
  "textTemplate": {"template":"{currNum} {currUnit} of {fullNum} {fullUnit}","vars":{"currNum":"%.2f","currUnit":"%s","fullNum":"%.0f","fullUnit":"%s"}}
}
Field Values What it does
template string with variables in curly braces Final text.
vars object with variable formats Formats variable values.

Template Variables

Variable Default format What it shows
{currNum} %.2f Current distance from the start of the track to the current moment.
{currUnit} %s Measurement unit for {currNum}.
{fullNum} %.0f Total track distance from the last distance sensor atom.
{fullUnit} %s Measurement unit for {fullNum}.

Clone this wiki locally