Update documentation to mention 'precision' as widget option

This commit is contained in:
Marc Meszaros
2023-04-26 10:29:34 -07:00
parent 7ab10b5c10
commit b80209f7da

View File

@@ -187,7 +187,7 @@ function MyNodeType()
```
This is the list of supported widgets:
* **"number"** to change a value of a number, the syntax is ```this.addWidget("number","Number", current_value, callback, { min: 0, max: 100, step: 1} );```
* **"number"** to change a value of a number, the syntax is ```this.addWidget("number","Number", current_value, callback, { min: 0, max: 100, step: 1, precision: 3 } );```
* **"slider"** to change a number by dragging the mouse, the syntax is the same as number.
* **"combo"** to select between multiple choices, the syntax is:
@@ -205,6 +205,7 @@ The fourth optional parameter could be options for the widget, the parameters ac
* **property**: specifies the name of a property to modify when the widget changes
* **min**: min value
* **max**: max value
* **precision**: set the number of digits after decimal point
* **callback**: function to call when the value changes.
Widget's value is not serialized by default when storing the node state, but if you want to store the value of widgets just set serialize_widgets to true: