Logic Boards
Logic boards are collapsible windows that encapsulate multiple logic blocks. They have their own inputs and outputs so that they can connect to other boards and logic blocks in your scene.
They can help keep your project neat and tidy. But in addition to than that, because they can be duplicated, they're a great way to create reusable blocks of code.
This logic board defines a single input that goes to an entity, in this case a key in the sample synth project. This board looks for a keyboard input and when that key is pressed it modifies the transform of that key to make it appear to have been pressed (like a piano key).
And because this project has 5 keys with similar functionality, adding this logic to the other 4 keys is as simple as duplicating the board, attaching it to the other keys, and then changing the keyboard input to match each key.
That's just good math
So instead of 25 logic blocks (5 keys * 5 blocks each) you end up with 5 logic boards which you can collapse and forget about until you need them again
Adding Logic Boards
Similar to adding a logic block, from the Play Tab open the lgoic library and drag in a logic board. You can resize and position it as you'd expect.
Adding Logic Blocks
To add logic blocks to your boards, they must first be minimized. Then you can drag and drop them into the logic board.
These blocks will now move with the board and will be collapsed into a single logic board icon when minimized.
Board Manipulation
You can rename a board by double clicking in the text field at the top of the board.
To bring a board front and center, click on the focus icon. This will give you extra space to work on the board's internal logic.
Connecting Internal Logic
From within a logic board, you can connect logic while the logic blocks are minimized OR you can open them up to make connections. You will find that when working with many logic blocks, you will only have one or two expanded at a time but may still need to make connections to other minimized blocks.
Blocks that have been expanded still belong to logic board but can move independently of it until the block or board is minimized - at which point it will snap back into the board.
Connecting External Logic
In order to connect the inputs or outputs of any of the blocks inside of a logic board, simply drag a connect to the edge of the board:
- left side for inputs
- right side for outputs
I/O dots will appear on the outside of the logic board which which you can then connect to other boards or other blocks, the same as with Logic Blocks.
Boards within Boards
In case you're wondering, yes you can nest logic boards inside other logic boards... so long as you can keep it all straight in your head
While graphs like this might look busy, they'd be MUCH busier without logic boards AND if you're so inclined much of this could be collapsed down into just a few boards - one for each character and key. Take it as deep or shallow as you're willing to go!