Chip
This view allows you to display a text (or a resource) as a chip. It's most useful for tags, statuses and properties.
JSON Format
{
"type": "chip",
"id": ...,
"type": ...,
"margin_left": ...,
"margin_right": ...,
"margin_top": ...,
"margin_bottom": ...,
"is_visible": ...,
"validation_message": ...,
"text": ...,
"on_tap_event": ...,
"background_color": ...,
"border_color": ...,
"style": ...,
"resource_id": ...,
"resource_instance_ids_stat": ...,
"resource_display_stat": ...
}
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. | |
text | StatFormulaComponent | Should compute to the text to be displayed on the chip. Either this property should be provided, or resource_id, resource_instance_ids_stat and resource_display_stat should be provided. | |
on_tap_event | Event | Optional. The event that should be fired when the chip is tapped, if any. | |
background_color | String | Optional. The background color for the chip. Should compute to a string for an RPGColors or a hex code for a color. | |
border_color | String | Optional. The border color for the chip. Should compute to a string for an RPGColors or a hex code for a color. | |
style | ChipRPGViewStyle | Optional. The style color for the chip. Should compute to a string representing a ChipRPGViewStyle. Defaults to fullSize. | |
resource_id | String | The id of the resource the chip is going to display. | |
resource_instance_ids_stat | String | The stat for the id or ids of resource instances that are going to be displayed in the chip. The stat has to have a string value or be an array of strings. | |
resource_display_stat | String | The stat of the resource that should be used to display in the chip. Most usually it's name. |