You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can also grab events from the mouse in case your node has some sort of special interactivity.
157
157
@@ -187,16 +187,16 @@ function MyNodeType()
187
187
```
188
188
189
189
This is the list of supported widgets:
190
-
***"number"** to change a value of a number, the syntax is ```this.addWidget("number","Number", current_value, callback, { min: 0, max: 100, step: 1} );```
190
+
***"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 } );```
191
191
***"slider"** to change a number by dragging the mouse, the syntax is the same as number.
192
192
***"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
205
205
***property**: specifies the name of a property to modify when the widget changes
206
206
***min**: min value
207
207
***max**: max value
208
+
***precision**: set the number of digits after decimal point
208
209
***callback**: function to call when the value changes.
209
210
210
211
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:
@@ -223,7 +224,7 @@ Or if you want to associate a widget with a property of the node, then specify i
223
224
functionMyNode()
224
225
{
225
226
this.properties= { surname:"smith" };
226
-
this.addWidget("text","Surname","", { property:"surname"}); //this will modify the node.properties
227
+
this.addWidget("text","Surname","", { property:"surname"}); //this will modify the node.properties
227
228
}
228
229
```
229
230
## LGraphCanvas
@@ -277,7 +278,7 @@ To define slots for nodes you must use the type LiteGraph.ACTION for inputs, and
0 commit comments