setNumber

abstract fun setNumber(key: String, value: Float, target: VariableTarget?)

Set a number variable. Creates the variable if no variable has this key. Every block property bound to the variable takes the value that the scene shows. If a bound property rejects the value, the call throws its error, but the variable and the other bound properties change anyway. Experimental: this API may change in a minor release.

Parameters

key

the variable's key.

value

the number value. Must be finite.

target

the layer to write. null writes the active value set when it holds the key, else the default value, so that the getter returns the new value. A value set needs a variable of this type.


open fun setNumber(key: String, value: Float)

Set a number variable in the layer that the scene shows. Same as setNumber with no target.