![]() |
uvi-script
Musical event scripting with Lua
|
2 states boolean button. More...
Public Member Functions | |
| OnOffButton (string name, bool def) | |
| creates a stateful on/off button widget on the user interface. | |
| void | setValue (bool value, bool callChangedCallback=true) |
| void | setStripImage (string imagePath, int numFrames) |
| dress the button from one image holding a frame per state, stacked top to bottom in the order off, on, hovered off, hovered on, held off, held on. | |
| void | setLottieAnimation (string path, string mode) |
| dress the button with a Lottie animation. | |
Public Attributes | |
| bool | value |
| the button's state | |
| bool | default |
| the button's default state | |
| bool | showPopupDisplay |
| show/hide the value popup display (if any) | |
| string | normalImage |
| image path for the off state | |
| string | pressedImage |
| image path for the on state, and for the button while held down | |
| string | overImage |
| image path for the mouse being over the button while it is off | |
| string | overPressedImage |
| image path for the mouse being over the button while it is on | |
| string | backgroundColourOff |
| background colour Off: colour string that defines the desired colour. | |
| string | textColourOff |
| textColour Off: colour string that defines the desired colour. | |
| string | backgroundColourOn |
| background colour On: colour string that defines the desired colour. | |
| string | textColourOn |
| textColour On: colour string that defines the | |
| number | fontSize |
| font size | |
| string | font |
| path to TrueType font | |
| bool | triggeredOnMouseDown |
| Sets whether the button click should happen when the mouse is pressed or released. | |
| string | stripImage |
| path to the strip image. | |
| string | lottieAnimation |
| path to a Lottie animation or package, see Lottie Animations | |
Public Attributes inherited from ParamWidget | |
| Mapper::Type | mapper |
| Mapper type, default is Mapper.Linear. | |
| Unit::Type | unit |
| Unit type, default is Unit.Generic. | |
| int | paramId |
| parameter id, assigned automatically (read-only) | |
| bool | exported |
| default: false, set it to true to export this parameter as an automatable parameter | |
Public Attributes inherited from Widget | |
| string | name |
| widget name, given at construction (read-only) | |
| string | displayName |
| widget display name | |
| string | displayText |
| custom text to display in place of the standard value display, on widgets that show one. | |
| string | tooltip |
| widget tooltip, default is name | |
| int | x |
| x position in pixels | |
| int | y |
| y position in pixels | |
| int | width |
| widget width in pixels | |
| int | height |
| widget height in pixels | |
| int | w |
| alias of width | |
| int | h |
| alias of height | |
| table | size |
| widget size {width, height} | |
| table | position |
| widget position {x,y} | |
| table | pos |
| alias of position | |
| table | bounds |
| widget bounding rect {x,y,width,height} | |
| number | alpha |
| transparency value between 0.0 and 1.0 | |
| bool | enabled |
| boolean flag to enable / disable the widget | |
| bool | visible |
| boolean flag to toggle widget visibility | |
| bool | interceptsMouseClicks |
| boolean flag to toggle mouse handling on widget. | |
| bool | showLabel |
| show widgets label if any | |
| bool | persistent |
| flag to tell if the widget values should be serialized when saving. | |
| function | changed |
| callback function used by child widgets to be notified of changes. | |
2 states boolean button.
creates a stateful on/off button widget on the user interface. Image properties support Retina @2x variants.
| OnOffButton::OnOffButton | ( | string | name, |
| bool | def ) |
creates a stateful on/off button widget on the user interface.
| name | the name to give to the widget |
| def | default value to give to the widget |
| void OnOffButton::setLottieAnimation | ( | string | path, |
| string | mode ) |
dress the button with a Lottie animation.
See Lottie Animations.
| path | path to a .json animation or a .lottie package |
| mode | "toggle" walks the animation on and off, "trigger" replays it from the first frame on every click; any other string reads as "toggle". The argument is required – a call with the path alone raises an error. To keep the toggle mode, assign the lottieAnimation property instead |
| void OnOffButton::setStripImage | ( | string | imagePath, |
| int | numFrames ) |
dress the button from one image holding a frame per state, stacked top to bottom in the order off, on, hovered off, hovered on, held off, held on.
Fewer frames are read as the first few of that order, so a strip may stop wherever the separate images stopped. Supports Retina @2x variants.
| imagePath | path to the strip image |
| numFrames | how many frames the image holds |
| void OnOffButton::setValue | ( | bool | value, |
| bool | callChangedCallback = true ) |
| value | the new widget's value |
| callChangedCallback | call the changed callback function if true |
| string OnOffButton::backgroundColourOff |
background colour Off: colour string that defines the desired colour.
It can be either a named colour like "blue" or "red" or an hexadecimal string in RGB ("#FF00CC") or ARGB ("#3C00FECD") format
| string OnOffButton::backgroundColourOn |
background colour On: colour string that defines the desired colour.
It can be either a named colour like "blue" or "red" or an hexadecimal string in RGB ("#FF00CC") or ARGB ("#3C00FECD") format
| string OnOffButton::stripImage |
path to the strip image.
Nothing is drawn from a strip until the frame count is given, so assigning this alone is inert – call setStripImage
| string OnOffButton::textColourOff |
textColour Off: colour string that defines the desired colour.
It can be either a named colour like "blue" or "red" or an hexadecimal string in RGB ("#FF00CC") or ARGB ("#3C00FECD") format
| string OnOffButton::textColourOn |
textColour On: colour string that defines the
desired colour. It can be either a named colour like "blue" or "red" or an hexadecimal string in RGB ("#FF00CC") or ARGB ("#3C00FECD") format
| bool OnOffButton::triggeredOnMouseDown |
Sets whether the button click should happen when the mouse is pressed or released.
By default the button is only considered to have been clicked when the mouse is released