Update 'ModuleJSONProperty'

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

@@ -1,101 +1,101 @@
# 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.
```JSON
{
"name": "Property 1",
"type": "text",
"description": "Enter some text",
"value": "Hello World!"
}
```
|Property|Description|
|-|-|
name | Name of the property, this will be visible in the scene editor.
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.
value | The default value for the property.
## 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.
### text
Text input field
|Parameter|Type|Description|
|-|-|-|
|value|string|The default value for the property.
### textarea
Multiline text input field
|Parameter|Type|Description|
|-|-|-|
|value|string|The default value for the property.
### number
Number input field
|Parameter|Type|Description|
|-|-|-|
|value|number|The default value for the property.
|min|number|The minimum value.
|max|number|The maximum value.
|step|number|The step to increase/decrease with.
### slider
Range slider
|Parameter|Type|Description|
|-|-|-|
|value|number|The default value for the property.
|min|number|The minimum value.
|max|number|The maximum value.
|step|number|The step to increase/decrease with.
### color
Color picker
|Parameter|Type|Description|
|-|-|-|
|value|string|The default value for the property.
### checkbox
|Parameter|Type|Description|
|-|-|-|
|value|boolean|The default value for the property.
### time
Time selector
|Parameter|Type|Description|
|-|-|-|
|value|number|The default value (unix epoch seconds) for the property.
### date
Date selector
|Parameter|Type|Description|
|-|-|-|
|value|number|The default value (unix epoch seconds) for the property.
### datetime
Date + Time selector
|Parameter|Type|Description|
|-|-|-|
|value|number|The default value (unix epoch seconds) for the property.
### select
Dropdown select
|Parameter|Type|Description|
|-|-|-|
|value|string|The default selected value for the property.
|allowedValues|{id:string, text:string}[]|The values that can be selected.
### file
Select file from filebrowser
|Parameter|Type|Description|
|-|-|-|
|value|null|
|multi|boolean|Can select multiple files.
|allowedTypes|string[]|Selectable file types. Can be `image`, `video`, `audio`, `font`, `pdf`, `animation`, `vectorImage`
### giphy
Grab animation from Giphy
|Parameter|Type|Description|
|-|-|-|
|value|null|
# 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.
```JSON
{
"title": "Property 1",
"type": "text",
"description": "Enter some text",
"value": "Hello World!"
}
```
|Property|Description|
|-|-|
name | Name of the property, this will be visible in the scene editor.
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.
value | The default value for the property.
## 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.
### text
Text input field
|Parameter|Type|Description|
|-|-|-|
|value|string|The default value for the property.
### textarea
Multiline text input field
|Parameter|Type|Description|
|-|-|-|
|value|string|The default value for the property.
### number
Number input field
|Parameter|Type|Description|
|-|-|-|
|value|number|The default value for the property.
|min|number|The minimum value.
|max|number|The maximum value.
|step|number|The step to increase/decrease with.
### slider
Range slider
|Parameter|Type|Description|
|-|-|-|
|value|number|The default value for the property.
|min|number|The minimum value.
|max|number|The maximum value.
|step|number|The step to increase/decrease with.
### color
Color picker
|Parameter|Type|Description|
|-|-|-|
|value|string|The default value for the property.
### checkbox
|Parameter|Type|Description|
|-|-|-|
|value|boolean|The default value for the property.
### time
Time selector
|Parameter|Type|Description|
|-|-|-|
|value|number|The default value (unix epoch seconds) for the property.
### date
Date selector
|Parameter|Type|Description|
|-|-|-|
|value|number|The default value (unix epoch seconds) for the property.
### datetime
Date + Time selector
|Parameter|Type|Description|
|-|-|-|
|value|number|The default value (unix epoch seconds) for the property.
### select
Dropdown select
|Parameter|Type|Description|
|-|-|-|
|value|string|The default selected value for the property.
|allowedValues|{id:string, text:string}[]|The values that can be selected.
### file
Select file from filebrowser
|Parameter|Type|Description|
|-|-|-|
|value|null|
|multi|boolean|Can select multiple files.
|allowedTypes|string[]|Selectable file types. Can be `image`, `video`, `audio`, `font`, `pdf`, `animation`, `vectorImage`
### giphy
Grab animation from Giphy
|Parameter|Type|Description|
|-|-|-|
|value|null|
View this in a [complete module.json example](./module.json).