Repository navigation
TextIndicator JSON
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.
The indicator layer is saved in two modes:
-
toJSON(false)— the real Mixel state: the layer hassizeandpositionInParent. -
toJSON(true)— the template state:maketis written instead ofsizeandpositionInParent.
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.
{
"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.
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 }
}
}
}{
"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.
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(0plain,1bold,2italic),size(integer 1–999),color(r,g,b,ain the range 0–255). -
textAlign—{"value": 0..8}:0TOP_LEFT,1TOP_CENTER,2TOP_RIGHT,3CENTER_LEFT,4CENTER,5CENTER_RIGHT,6BOTTOM_LEFT,7BOTTOM_CENTER,8BOTTOM_RIGHT. A value out of range is treated asCENTER_LEFT.
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 }
}-
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.