ViewPager
This view allows you to segment / divide a page into several subpages that will be accessible by scrolling horizontally. This is particularly useful when creating edit views for resources that have a lot of stats, to avoid overwhelming the player and making it easier to find what they are looking for in a clutter-free fashion.
JSON Format
{
"type": "viewPager",
"id": ...,
"type": ...,
"margin_left": ...,
"margin_right": ...,
"margin_top": ...,
"margin_bottom": ...,
"is_visible": ...,
"validation_message": ...,
"subviews": ...,
"names": ...,
"color": ...
}
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. | |
subviews | List<RPGView> | ✓ | A list of subviews, one for each subpage that should be displayed |
names | StatFormulaComponent | ✓ | A formula that should compute to a list of strings, one for each of the pages specified in subviews (in the same order). These names will be shown as titles for each of the pages. |
color | StatFormulaComponent | Optional. Defaults to black. Should compute be a string for an RPGColors or a hex code for a color that will be used for the banner containing the name of the current page. |