From what I can understand from the documentation, the “visible” property is not available for direct manipulation: set(target_element_id.visible, false)
Is there some other way to be able to toggle elements visibility using a toggle button, or matrix or what have you…?
The most simple way to do it is to write the conditional logic directly in the widget’s visible
property:
@{toggle_1}
is fine if the toggle’s values are 0/1, or for finer control:
JS{{
// now it depends on a fader's value
if (@{fader_1} > 0.5) return true
else return false
}}
Btw, set()
is only meant to change a widget’s value, the first argument must be a string (the widget’s id). Currently, changing a widget’s property from a script cannot be done with a single function call, you need to change a widget’s* value (with set()
) that’s used to define the other widget’s property (with @{}
).
*Edit: as of beta8, said widget can be of type “variable” (in the “scripts” category), these are invisible and can be used as global variables.
1 Like