Skip to content

Commit

Permalink
Merge pull request jagenjo#384 from MarcMeszaros/guide-number-widget-…
Browse files Browse the repository at this point in the history
…precision

Update documentation to mention 'precision' as widget option
  • Loading branch information
jagenjo authored Apr 28, 2023
2 parents 976ba6f + b80209f commit e27ecd1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion guides/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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:
Expand Down

0 comments on commit e27ecd1

Please sign in to comment.