Transitions configuration
Using
Set up transitions between the Integratedthree StateStates Machinecreated
CGI Studio provides a powerful feature to realize application logic via an integrated state machine model. Combined with controls and behaviors, it supports building complex application logic withoutin the needprevious for programming.operation. In this section, scene transitions will be implemented via the State Machine.Machine TheEditor, goaltransitions are set using Transitions. This transition consists of a Sender, Condition, and Action. Therefore, if the set Condition is toevaluated triggeras scene transitions by clicking specific nodes in"true," the scene.set Action is executed.
Transition Configurations
How
The toTransition displayfunction of the State Machine Editor panelis
Theused stepsto set up transitions between states. Transitions are indicated by connecting each state with an arrow.


With Transition selected, from the lower left of the State Machine Editor
1. Click the triangular icon beside Solution > State Machines in Solution Explorer.
2. Double-click GlobalStateMachine[ thatFusion... is shown after expanding State Machines.
- The
StatepanelMachinewillEditorswitchistoshown.the Fusion panel and the Fusion diagram for the Transition will be displayed. - The
StateconnectorMachine Editor can also be opened by selecting View > State Machine > State Machine Editor(Condition) in themenuupperbar.

The GlobalStateMachine already contains an Initial State (represented by the round icon), a State Transition (represented by the arrow), and a State (represented by the rectangle). An initial state is the entry pointcorner of the stateTransition machine.Fusion Anode stateis denotesconnected ato giventhe logicalCheck statusClick Fusion node.

Enter "Transition Request" in the search field at the top of the dialog.
The following settings are made for the

State setting
Configure each state for transitioningscene to thebe nexttransitioned scene.to Followin the steps[ belowIdentifier after].
1. Click State on State Machine Editor.
2. Change Name on Propertiesdisplay to Car_Cluster.

3. Create additional states for Car_Status and Incoming_Call. You can do this by dragging and dropping states from the State Machine Editor ToolBar into the State Machine Editor. Don't forget to adjust the name of the states to "Car_Status" and "Incoming_Call".

Whenever a certain state is entered, the corresponding scene should be activated. Therefore, an OnEntry action is necessary for all 3 states.
Whenever a certain state is exited, the corresponding scene should be deactivated. Therefore, an OnExit action is necessary for all 3 states.
4. Add an OnEntry and an OnExit action to each of the 3 states. To do this, select a state and click on the "+" signs next to "OnEntry" and "OnExit.

5. Configure the OnEntry and OnExit actions according to the following table:
Identifier

Transition setting
Set-up
To create a transition, use the Transitions icon from the State Machine Editor's toolbar.

And this is how a transition is made in State Machine Editor: Drag a Transition (arrow icon) from the State Machine Editor toolbar and drop it on a state (the state of the transition's origin). Then drag the mouse to the target state and click onto the target state. An arrowRequestType will be drawnActivate from the transition's origin state to the transition's target state.(default).
1. Draw transitions between the states clock-wise
| Transition |
|
Incoming_Call to Car_Status |
Solution>Scenes>Car_Status |
| Car_Status to Car_Cluster |
Solution>Scenes>Car_Cluster |
Solution>Scenes>Incoming_Call Incoming_Call
to Car_Cluster Solution>Scenes>Car_Cluster
When all settings have been completed, the diagram below shows the state.


2.The Drawabove settings set the scene to be displayed when the transition from each scene occurs.
Handle Control State
In the previous section, you used Transition to set the transition between each scene. Next, you will set the conditions under which these transitions betweenoccur. The Transition you added has a Condition behavior called "Check Click" initially set. Therefore, a "Handle Control State" is added to the statestarget counter-clock-wisenode in order to send state events from each scene as triggers to this Condition behavior.
Click on [ Cluster>StatusTop>Telltales ] in the scene tree to expand it.
Click on the IndicatorRight group node and click on [ Fusion... ] in the Extra Scene tree.

Drag and move the mouse over the connector on the right side of the IndicatorRight Fusion node in the Fusion diagram and release left click anywhere.
Enter "Handle Control state" in the search field at the top of the dialog.
Double-click the "Handle Control state".

Perform the step 3 through step 6 above for "IndicatorLeft" as well.
With the above settings, State events are sent to Condition "Check Click" as State conditions.
Transition Conditions
Finally, to connect the event destination of the Handle Control State to the Condition, the configuration work is done in the State Machine Editor.
With Transition selected, from the lower left of the State Machine Editor panel, click [ Fusion... ].
The connector (Condition) in the upper right corner of the Transition Fusion node is connected to the Check Click Fusion node.
Click the Select item icon to the right of the [ Sender ] in the Check Click Fusion node.
Select the IndicatorRight node of the scene that will be the source of the screen transition from the list on the left side of the dialog and press the [ OK ] button in the dialog.

Click on the up arrow icon in the upper right corner of the Fusion panel.
Repeat the above operation for other interstate transitions to set the Sender.
| Transition |
Car_Status to Car_Cluster Car_Status Car_Cluster
to Car_Status Car_Cluster Car_Status to Incoming_Call
Car_Status Incoming_Call to Car_Cluster
3. The final State Machine diagram will look like this:

Each arrow represents a State Transition e.g. from the Car_Cluster state to the Car_Status state. A transition contains a sender object, a condition, and an event. If the newly added Transition is selected, by default it already contains a Check Click condition and a Clicked event.
In our example, we want to transition clock-wise when clicking on the IndicatorRight of the scenes' top status bar.And we want to transition counter-clock-wise when clicking on the IndicatorLeft of the scenes' top status bar.
In order to achieve this, the left and right indicators of all three scenes have to be extended with a HandleControlState. The next part describes how this can be done.
Handle Control State
For the Check Click condition behavior, an event from the scene is expected to trigger and match this condition. Therefore, it is necessary to switch back to Scene Editor to setup the events/triggers.
1. Double click Car_Cluster in Solution Explorer.
2. Click IndicatorRight after expanding Cluster > StatusTop > Telltales on Scene Tree.
3.The Selectabove Handlesteps Control State from Behavior ofcompletes the ToolBox.
4. Add Handle Control State to IndicatorRight node by drag-and-drop operation.

5. Also add Handle Control State to IndicatorLeft.
6. Repeat the same steps 1 to 5setup for Incoming_Callexecuting and Car_Status scene.
Following the steps above, State Events are sent to the state condition, particularly Check Click condition. To connect Handle Control State events to the condition, switch back to State Machine Editor.
7. Display the State Machine Editor panel.
8. In the State Machine Diagram select a transition that connects two states (e.g. the transitiontransitions between Car_Cluster and Car_Status).

9. Have a look at the transition's properties. In Properties panel, set the Sender to the IndicatorRight node of the scene where this transition originates.

10. Repeat steps 8 to 9 above on the other transitions that connect two states. Make sure to set to the correct Sender from the correct scene.
The steps above set the parameters such that the state will transitionStates based on triggers and events received from nodes in the scene.
Displaying Multiple Scenes
To visualize the scene transitions, the cameras of the other two scenes need to be added to the render target.
1. Referring to the operations described in Setting up the Display, add the cameras Car_Status\DocumentView and Incoming_Call\DocumentView to the RenderTarget.

2. Click the Play button in the menu bar to run CGI Player.
3. Click the IndicatorRight (the green arrow pointing to the right) in the Car_Cluster scene. It should show the Incoming_Call scene as seen below.
