script: add condition prop
This commit is contained in:
parent
84b06b4807
commit
7f632ef081
2 changed files with 14 additions and 3 deletions
|
|
@ -83,10 +83,16 @@
|
|||
}
|
||||
```
|
||||
|
||||
### `condition`
|
||||
- type: `string`
|
||||
- default: `''`
|
||||
- usage: when the widget receives a value, if this property return a falsy value, the `script` property won't be evaluated. If it's non-falsy, it will be evaluated normally. [Formulas](../extras/advanced-property-syntax/#formulas) are given 1 extra variable in this context:
|
||||
- `value`: the value received by the widget
|
||||
|
||||
### `script`
|
||||
- type: `string`
|
||||
- default: `''`
|
||||
- usage: this property is evaluated each time the widgets receives a non-falsy value. [Formulas](../extras/advanced-property-syntax/#formulas) are given extras variables in this context:
|
||||
- usage: this property is evaluated each time the widget receives a value if `condition` is non-falsy. [Formulas](../extras/advanced-property-syntax/#formulas) are given extras variables in this context:
|
||||
- `value`: the value received by the widget
|
||||
- `send`: `function` for sending osc messages
|
||||
- `set`: `function` for setting a widget's value
|
||||
|
|
@ -96,6 +102,7 @@
|
|||
- `address` (`string`): a valid osc address
|
||||
- `arg`: one or several osc arguments to be sent. The script's `preArgs` property is ignored
|
||||
|
||||
|
||||
#### `set(id, value)`
|
||||
- `id` (`string`): a widget's id
|
||||
- `value`: the widget's new value
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue