For updates, you should follow me on

Using math expressions

UP Deck tries to evaluate anything enclosed in square brackets. When a deck button is pressed, math expressions are evaluated before the actions are sent to OBS.



Example - if you have defined values $stream_width, $stream_height and $margin (see setting custom values), then you could position an object near the top right of the screen  by using;


Place object near top right




x=[ $stream_width - $margin ]

y=[ $margin ]




As well as the standard math operators for addition, subtraction, multiplication and division (+, -. *, /), all of the functions listed in the Corona Math Library will also work.



Eample - update a text object with a random number between 5 and 10.


Update text source with random number



text=[ random(5, 10) ]



When used with loops, this functionality allows you to create some more complex animations without having to write a lot of individual button commands.



Prev: Using repeat loops in buttons  
Next: Drawing live on stream

© 2021