Ticker
This view displays as a ticker/counter for numbers.
JSON Format
{
"type": "ticker",
"id": ...,
"type": ...,
"margin_left": ...,
"margin_right": ...,
"margin_top": ...,
"margin_bottom": ...,
"is_visible": ...,
"validation_message": ...,
"stat": ...,
"style": ...,
"button_location": ...,
"button_look": ...,
"change_amount": ...,
"allowed_values": ...,
"min_value_allowed": ...,
"calculated_min_value_allowed": ...,
"max_value_allowed": ...,
"calculated_max_value_allowed": ...,
"label": ...,
"label_alignment": ...,
"should_auto_save": ...,
"always_show_sign": ...,
"edit_bottom_sheet_title": ...
}
Fields
| Field | Type | Required | Description |
|---|---|---|---|
id | String | ✓ | A unique identifier for the view. You can use it to reference view values in stat formulas by doing $view.view_id (where view_id is the id that was assigned to this view by you in the system definition) |
type | RPGViewType | ✓ | The type of this view. Note that these are all in camelCase. |
margin_left | double | Optional. How much margin to add to the left of this view. | |
margin_right | double | Optional. How much margin to add to the right of this view. | |
margin_top | double | Optional. How much margin to add to the top of this view. | |
margin_bottom | double | Optional. How much margin to add to the bottom of this view. | |
is_visible | StatFormulaComponent | Optional. A formula to specify if the view should be visible or not. Must return a bool. | |
validation_message | StatFormulaComponent | Optional. If this view is an input, you can define this formula to return a message when the input value is invalid. If the input is valid, you should return null. Otherwise, make the formula return the string that should be shown to the user. | |
stat | String | ✓ | The path to the stat that should be linked (displayed and edited) by this ticker view. Should be a number stat (integer or decimal) |
style | TextRPGViewStyle | Optional. Defaults to text. The style to use for the ticker text as well as the label (if any). | |
button_location | TickerButtonLocation | Optional. Defaults to null, which will cause the ticker to not have any buttons. | |
button_look | TickerButtonLook | Optional. Defaults to plusMinus. The look of the buttons of this ticker view. | |
change_amount | double | Optional. Defaults to 1. The numeric amount that the ticker value should be incremented / decremented by when the player taps on the buttons. | |
allowed_values | StatFormulaComponent | Optional. Defaults to all numeric values (no restriction). A formula for a list of values that the ticker is allowed to take. Should compute to a list of numbers. | |
min_value_allowed | double | Optional. Defaults to no minimum. The minimum value that the ticker is allowed to take. | |
calculated_min_value_allowed | StatFormulaComponent | Optional. Defaults to no minimum. Analogous to min_value_allowed, but allows you to calculate this value in runtime instead. This formula should compute to a valid number. If both this property and min_value_allowed are provided, the latter will take precedence. | |
max_value_allowed | double | Optional. Defaults to no maximum. The maximum value that the ticker is allowed to take. | |
calculated_max_value_allowed | StatFormulaComponent | Optional. Defaults to no maximum. Analogous to max_value_allowed, but allows you to calculate this value in runtime instead. This formula should compute to a valid number. If both this property and max_value_allowed are provided, the latter will take precedence. | |
label | StatFormulaComponent | Optional. Defaults to no label. A formula for the text of a label that will display next to the ticker. This can be useful to add extra information about what the ticker represents. e.g: "HP". | |
label_alignment | TickerLabelAlignment | Optional. Defaults to right. The alignment of the label with respect to the ticker. | |
should_auto_save | bool | ✓ | Optional. Defaults to false. This flag indicates if any change to the control's state should automatically be saved for the resource / character, without giving the player the option to choose if they want to save or not. |
always_show_sign | bool | Optional. Defaults to false. If a sign should always be prepended to the number (e.g: +5). | |
edit_bottom_sheet_title | StatFormulaComponent | Optional. Defaults to none. If provided, the app will try to display a bottom sheet to edit (add and subtract from) the ticker value when the player taps on it. This will only work if both change_amount is omitted (or equal to 1) and the allowed_values property is omitted. |