Logic Gates are graphical representations of Logic that perform a specific task. Gates can used to produce or modify data, as well as to produce and stop events.
A list of available gates are shown in the left hand side of the Logic Maker. By hovering over the gate, a brief summary of the gate's function will pop up.
Inserting Gates
To insert Gates into the Logic Maker Canvas click on them from the left hand list.
To delete a Gate, you can either right click on the Gate and select Delete, or highlight an area with your mouse and then press delete on your keyboard.
Connecting Gates
To connect your gates drag from one port to the next. This only work when dragging a parent port (right side of the Gate) to a child port (left side of the Gate).
To disconnect either drag the point out or double click on the link.
OR
Gate Connections Order
In some cases the order that you connect the gates will affect the behaviour of your logic. An example would be the CHOICE Gate.
The CHOICE Gate requires a selector value to be pushed into the Selector port before being activated by an event in the Data port. To see the order in which the ports were connected you can press CTRL + L on the keyboard. This will label your connections in the order they were connected.
In the example below, you should see that the gates were connected in the correct order. The event will pass through the VALUE Gate first to set the CHOICE Gate to set the output to port 1. Next the event from the second connection will send the event through the Data port on the CHOICE Gate, which will trigger the previously set port 1 to send out an event.
Creating Shortcut Gates
In some cases you will want to loop your logic back to beginning sections of your logic. In the case below, we want to loop the "then" port of the IF Gate back to the "stop" port of the CLOCK Gate.
You could simply do this by connecting the "then" port of the IF Gate back to the "stop" port of the CLOCK Gate. In this instance it is not so bad since there aren't many gates, so it is still obvious where the connections link to. In more complex situations you will find that these links will clutter your logic and make it harder to follow.
For situations like these there are Shortcut Gates. By right clicking on any gate you can create a shortcut version. So in this case we will create a CLOCK Shortcut Gate.
As you can see there is now a smaller gate with the same ports as the CLOCK Gate. If you hover over any Shortcut Gate you the corresponding original gate will glow in a green colour. This helps you keep track of the original gate the shortcut was created from.
We can now use the shortcut gate as we would a normal gate. The ports of a Shortcut Gate are not labelled, but you can use the original gate as reference to connect the gate up.
Grouping Gates
As your logic becomes more complex you may face situations where you your canvas gets cluttered with gates. One way to alleviate this is to organise your logic is by using groups.
In the example below we have a PLAY Gate that triggers two different streams of logic.
We will organise the logic above by using groups.
- First select the Logic Gates you want to group by clicking and dragging a selector box around them.
- With the gates selected right click on one of the selected gates to open a menu. From the list select Group.
- Your logic will now be replaced with a folder in the canvas. To open this folder either right click and select Open or double click on the folder.
- When opened the folder will contain the logic that was grouped. You can continue to add to the logic, however if you delete gates that are connected to gates outside of the group, you logic will no longer be connected to the main logic.
- To rename the group click the text under the folder icon and type the desired name.
- To ungroup your logic right click on the folder and select Unpack. This will replace the folder with the logic within the grouped folder.