Update 'ModuleJSONProperty'

2023-05-19 13:53:29 +00:00
parent 797980b651
commit 47f03d02b0

@@ -1,101 +1,101 @@
# Module.json Property # Module.json Property
Each property consists of a property-type, some metadata and of course the value. Below is an example of what a basic property looks like. Each property consists of a property-type, some metadata and of course the value. Below is an example of what a basic property looks like.
```JSON ```JSON
{ {
"name": "Property 1", "title": "Property 1",
"type": "text", "type": "text",
"description": "Enter some text", "description": "Enter some text",
"value": "Hello World!" "value": "Hello World!"
} }
``` ```
|Property|Description| |Property|Description|
|-|-| |-|-|
name | Name of the property, this will be visible in the scene editor. name | Name of the property, this will be visible in the scene editor.
type | Property type, see below. type | Property type, see below.
description | A description what the property does, this will be shown when a user clicks the questionmark next to the property in the scene editor. description | A description what the property does, this will be shown when a user clicks the questionmark next to the property in the scene editor.
value | The default value for the property. value | The default value for the property.
## Property Types ## Property Types
The property type specifies how the property should behave in the editor. Some properties have additional parameters you must/can set. Below you can find all property types and additional parameters. The property type specifies how the property should behave in the editor. Some properties have additional parameters you must/can set. Below you can find all property types and additional parameters.
### text ### text
Text input field Text input field
|Parameter|Type|Description| |Parameter|Type|Description|
|-|-|-| |-|-|-|
|value|string|The default value for the property. |value|string|The default value for the property.
### textarea ### textarea
Multiline text input field Multiline text input field
|Parameter|Type|Description| |Parameter|Type|Description|
|-|-|-| |-|-|-|
|value|string|The default value for the property. |value|string|The default value for the property.
### number ### number
Number input field Number input field
|Parameter|Type|Description| |Parameter|Type|Description|
|-|-|-| |-|-|-|
|value|number|The default value for the property. |value|number|The default value for the property.
|min|number|The minimum value. |min|number|The minimum value.
|max|number|The maximum value. |max|number|The maximum value.
|step|number|The step to increase/decrease with. |step|number|The step to increase/decrease with.
### slider ### slider
Range slider Range slider
|Parameter|Type|Description| |Parameter|Type|Description|
|-|-|-| |-|-|-|
|value|number|The default value for the property. |value|number|The default value for the property.
|min|number|The minimum value. |min|number|The minimum value.
|max|number|The maximum value. |max|number|The maximum value.
|step|number|The step to increase/decrease with. |step|number|The step to increase/decrease with.
### color ### color
Color picker Color picker
|Parameter|Type|Description| |Parameter|Type|Description|
|-|-|-| |-|-|-|
|value|string|The default value for the property. |value|string|The default value for the property.
### checkbox ### checkbox
|Parameter|Type|Description| |Parameter|Type|Description|
|-|-|-| |-|-|-|
|value|boolean|The default value for the property. |value|boolean|The default value for the property.
### time ### time
Time selector Time selector
|Parameter|Type|Description| |Parameter|Type|Description|
|-|-|-| |-|-|-|
|value|number|The default value (unix epoch seconds) for the property. |value|number|The default value (unix epoch seconds) for the property.
### date ### date
Date selector Date selector
|Parameter|Type|Description| |Parameter|Type|Description|
|-|-|-| |-|-|-|
|value|number|The default value (unix epoch seconds) for the property. |value|number|The default value (unix epoch seconds) for the property.
### datetime ### datetime
Date + Time selector Date + Time selector
|Parameter|Type|Description| |Parameter|Type|Description|
|-|-|-| |-|-|-|
|value|number|The default value (unix epoch seconds) for the property. |value|number|The default value (unix epoch seconds) for the property.
### select ### select
Dropdown select Dropdown select
|Parameter|Type|Description| |Parameter|Type|Description|
|-|-|-| |-|-|-|
|value|string|The default selected value for the property. |value|string|The default selected value for the property.
|allowedValues|{id:string, text:string}[]|The values that can be selected. |allowedValues|{id:string, text:string}[]|The values that can be selected.
### file ### file
Select file from filebrowser Select file from filebrowser
|Parameter|Type|Description| |Parameter|Type|Description|
|-|-|-| |-|-|-|
|value|null| |value|null|
|multi|boolean|Can select multiple files. |multi|boolean|Can select multiple files.
|allowedTypes|string[]|Selectable file types. Can be `image`, `video`, `audio`, `font`, `pdf`, `animation`, `vectorImage` |allowedTypes|string[]|Selectable file types. Can be `image`, `video`, `audio`, `font`, `pdf`, `animation`, `vectorImage`
### giphy ### giphy
Grab animation from Giphy Grab animation from Giphy
|Parameter|Type|Description| |Parameter|Type|Description|
|-|-|-| |-|-|-|
|value|null| |value|null|
View this in a [complete module.json example](./module.json). View this in a [complete module.json example](./module.json).