Resource
This view allows you to display a resource by using the resource's declared
display_view, edit_view or list_view.
JSON Format
{
"type": "resource",
"id": ...,
"type": ...,
"margin_left": ...,
"margin_right": ...,
"margin_top": ...,
"margin_bottom": ...,
"is_visible": ...,
"validation_message": ...,
"resource_id": ...,
"stat": ...,
"view_type": ...,
"create_if_empty": ...
}
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. | |
resource_id | String | ✓ | The resource id for the type of resource being displayed (ie: the one defined in your resource within the system file). |
stat | String | ✓ | The path to the stat that contains the resource instance to display. This path can use the syntax for paths defined in the GetStat stat formula. The stat has to be a resource. If you want to display an array of resources (ie: multiple resources), please see the ResourceArray view. |
view_type | ResourceViewTypes | ✓ | The type of view you want to display. If the requested type does not exist in the system definition of the resource (ie: it's missing), this will cause an error. |
create_if_empty | bool | Optional. Defaults to false. Whether the app should automatically create an empty resource instance if the given stat's value is null. |