How to make decisions with true/false values
Vuo has a data type that represents whether a condition is met: the Boolean data type. If a node has a Boolean port, that port’s value can be one of two things: true or false. True means “yes, the condition is met”. False means “no, the condition is not met”.
When checking if conditions are met, you’ll often be working with nodes that have a Boolean output port. Many such nodes have a title that starts with “Is” or “Are”, like Is Greater than and Are Equal.
Here’s an example that writes a message on the console window when the user types the word “please”.
Below is an example (Are Any True node says yes (true) if the mouse is within at least one of the rectangles. The Are All True node says yes if the mouse is within both rectangles. The Is One True node says yes if the mouse is within one rectangle and not the other.
) that checks two conditions: is the mouse cursor within the blue rectangle? is it within the red rectangle? The
Here’s one more example. It demonstrates how conditions can be used to coordinate between nodes downstream of different triggers. The composition displays the message “Camera detected” once it starts receiving input from the user’s video camera, that is, once the Receive Live Video node’s trigger port starts firing events. The events from that trigger port change the Switch node’s output to true, indicating to the rest of the composition that “Camera detected” should be displayed.