Part 5: Configure State Machine
State Machine feature is used for transitioning from one state to another. In our example, we will have a Music state and a Navigation state. The transitions between these two are triggered by pressing the Music and Navigation buttons in the Menu section.
To configure the StateMachine click the triangular icon on the left of Solution > State Machines in Solution Explorer. Double-click GlobalStateMachine that is shown after expanding State Machines.

- The State Machine Editor is shown.
- Make sure the checkbox of Is Global on Properties is marked.

Select the already created State in the State Machine Editor, and change its Name to "Music" in the Properties panel.

Whenever we enter the "Music" state, the "Music" GroupNode shall get visible. When leaving the "Music" State, it shall get invisible. Therefore, an OnEntry action and an OnExit action has to be configured.
Create a new "OnEntry" action by pressing the "+" sign next to OnEntry. Configure an "Enable Rendering" action, where the TargetNode is the IVI_Sample scene's "Music" GroupNode. Check the "Visible" checkbox to configure that the "Music" GroupNode shall be set to visible when executing the action.
To choose the TargetNode, press the magnifying glass icon. Then select the "Music" GroupNode in the Choose Item dialog and press "OK".

Create a new "OnExit" action by pressing the "+" sign next to OnExit similar to the OnEntry action you have just configured. This time, the "Visible" checkbox should be unchecked. This way the "Music" GroupNode will be set to invisible when executing the action.

Add a "Handle Control State" Behavior to TextButton_Music and TextButton_Navigation node (which are in the Menu_button group). This can be done by draging-and-dropping the behavior from the Toolbox Behaviors panel

Return to the State Machine Editor panel. Drag and drop a State (for the Navigation State) from the upper right toolbar.

Select that State in the State Machine Editor, and change its name to "Navigation" in the Properties panel.
Whenever this state is entered, the Navigation GroupNode shall be visible and whenever this state is exited, the Navigation GroupNode shall get invisible.
Therefore, select the Navigation state and add an OnEnter and an OnExit action similar to what we did for the Music state.

Connect the two States in both directions with Transitions. Just drag a Transition from the toolbar onto the outgoing state (e.g. Music) then click onto the second state (e.g. Navigation).

Next, we will configure how these transition are triggered. Select each Transition and set the displayed Properties as shown below.


The Player starts displaying the Music screen (and we are in Music state). Use the menu buttons "Navigation" and "Music" to switch between Navigation and Music.
