My button has three states. How can I use Variables for this?

My button has three states. How can I use Variables for this?

You can use boolean or number variable to switch between states.

Please, check out the "Example.pcvd" document and the "Button" canvas in the "TabBar and Button" tab in example project.

You can use the ternary operator ?: in your expression to switch between different values. Check 'buttonFill' expression for two values. You can create similar expression for any number of values:

x == 1 ? option1 :
x == 2 ? option2 :
x == 3 ? option3 :
x == 4 ? option4 : option5

For Implementation details, check out the EXTabBarsAndButtonsViewController class.