Skip to main content

Ticker

This view displays as a ticker/counter for numbers.

Returns

integer | decimal

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": ...,
"hide_value": ...
}

Fields

FieldTypeRequiredDescription
idStringA 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)
typeRPGViewTypeThe type of this view. Note that these are all in camelCase.
margin_leftdoubleOptional. How much margin to add to the left of this view.
margin_rightdoubleOptional. How much margin to add to the right of this view.
margin_topdoubleOptional. How much margin to add to the top of this view.
margin_bottomdoubleOptional. How much margin to add to the bottom of this view.
is_visibleStatFormulaComponentOptional. A formula to specify if the view should be visible or not. Must return a bool.
@type bool
validation_messageStatFormulaComponentOptional. 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.
@type string
statStringThe path to the stat that should be linked (displayed and edited) by this ticker view. Should be a number stat (integer or decimal)
styleTextRPGViewStyleOptional. Defaults to text. The style to use for the ticker text as well as the label (if any).
button_locationTickerButtonLocationOptional. Defaults to null, which will cause the ticker to not have any buttons.
button_lookTickerButtonLookOptional. Defaults to plusMinus. The look of the buttons of this ticker view.
change_amountdoubleOptional. Defaults to 1. The numeric amount that the ticker value should be incremented / decremented by when the player taps on the buttons.
allowed_valuesStatFormulaComponentOptional. 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.
@type array<integer | decimal>
min_value_alloweddoubleOptional. Defaults to no minimum. The minimum value that the ticker is allowed to take.
calculated_min_value_allowedStatFormulaComponentOptional. 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.
@type integer | decimal
max_value_alloweddoubleOptional. Defaults to no maximum. The maximum value that the ticker is allowed to take.
calculated_max_value_allowedStatFormulaComponentOptional. 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.
@type integer | decimal
labelStatFormulaComponentOptional. 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".
@type string
label_alignmentTickerLabelAlignmentOptional. Defaults to right. The alignment of the label with respect to the ticker.
should_auto_saveboolOptional. 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_signboolOptional. Defaults to false. If a sign should always be prepended to the number (e.g: +5).
edit_bottom_sheet_titleStatFormulaComponentOptional. 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.
@type string
hide_valueboolOptional. Defaults to false. If true, the ticker numeric value is not displayed. Instead, the label value is shown in its place. A label must be provided when this is true.