Skip to content

TextIndicator JSON

roosit edited this page Oct 16, 2026 · 1 revision

TextIndicator JSON

Up | Code | Русский

Purpose

This page describes the persisted format of the text indicator in a project, in Mixel and in templates. For the user instructions on manually editing .vttp, see the page Text JSON.

Two save modes

The indicator layer is saved in two modes:

  • toJSON(false) — the real Mixel state: the layer has size and positionInParent.
  • toJSON(true) — the template state: maket is written instead of size and positionInParent.

The indicator properties are not tied to sensors, so they are written identically in both modes, and no automatic sensor selection is needed when a template is loaded.

Common indicator wrapper

{
  "name": "com.velitask.plagin.official.text",
  "data": {
    "properties": {}
  }
}
Part Value
plugin uid com.velitask.plagin.official
indicator name text

Besides properties, data contains the common layer fields (visibility, transparency, nested layers, etc.); they do not belong to the indicator and are not described here.

Real mixel state

The shape of size and positionInParent is determined by the current runtime, so it is shown in abbreviated form.

{
  "name": "com.velitask.plagin.official.text",
  "data": {
    "size": { "...": "layer size state" },
    "positionInParent": { "...": "layer position state" },
    "properties": {
      "value": { "value": "Text" },
      "font": { "name": "Dialog", "style": 0, "size": 48, "color": { "r": 255, "g": 255, "b": 255, "a": 255 } },
      "textAlign": { "value": 4 }
    }
  }
}

Template state

{
  "name": "com.velitask.plagin.official.text",
  "data": {
    "maket": { "preset": "auto" },
    "properties": {
      "value": { "value": "Text" },
      "font": { "name": "Dialog", "style": 0, "size": 48, "color": { "r": 255, "g": 255, "b": 255, "a": 255 } },
      "textAlign": { "value": 4 }
    }
  }
}

The values are the initial values from the code. The initial text comes from the plugin localization: "Текст" in the Russian locale, Text in the English one. When a template is written, maket in the toJSON(true) mode is the proportional preset with the fractions x, y, w, h; when reading, auto and fill are also accepted.

Properties

The row order matches defineProperties().

JSON key Java property SDK type User meaning Default
value mValue StringProperty The string to output ("Text"). Localized "Текст" / Text.
font mFont FontColorProperty Font and text color. Dialog, plain, 48, white.
textAlign mTextAlign TextAlignProperty Text alignment in the layer. {"value":4} (CENTER).

Value formats:

  • value — {"value": "<string>"}. If an empty string is saved, the property returns the default value (empty text cannot be obtained).
  • font — a flat object: name (string), style (0 plain, 1 bold, 2 italic), size (integer 1–999), color (r, g, b, a in the range 0–255).
  • textAlign — {"value": 0..8}: 0 TOP_LEFT, 1 TOP_CENTER, 2 TOP_RIGHT, 3 CENTER_LEFT, 4 CENTER, 5 CENTER_RIGHT, 6 BOTTOM_LEFT, 7 BOTTOM_CENTER, 8 BOTTOM_RIGHT. A value out of range is treated as CENTER_LEFT.

Examples

A bold yellow caption aligned to the left edge, vertically centered:

{
  "value": { "value": "Race 1" },
  "font": { "name": "Dialog", "style": 1, "size": 64, "color": { "r": 255, "g": 220, "b": 0, "a": 255 } },
  "textAlign": { "value": 3 }
}

Compatibility

  • VelitaskPlagin.getUID() (com.velitask.plagin.official) must not be changed without migrating saved projects.
  • Indicator.getName() (text) must not be changed without a migration.
  • The property names (value, font, textAlign) must not be renamed without a migration: loading goes by names.
  • Renaming a property is more dangerous than changing the order: the order mostly affects the interface.

Clone this wiki locally