Skip to main content

Part 5: Configure State Machine

State Machine feature is used for transitioning afrom screenone state to others.another. Here,In theour displayexample, iswe transitionedwill 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.

ClickTo configure the StateMachine click the triangular icon besideon the left of Solution > State Machines in Solution Explorer. Double-click GlobalStateMachine that is shown after expanding State Machines.

drawing-7-1676628402.pngdrawing-5-1696574919.png
  • The State Machine Editor is shown.
  • Make sure the checkbox of Is Global on Properties is marked.
drawing-7-1676628418.png
drawing-7-1676628429.pngdrawing-5-1696575053.png

ClickSelect the already created State onin the State Machine Editor, and change its Name onto "Music" in the Properties topanel.

Music.
drawing-5-1696575431.png
Set

Whenever we enter the Identifier"Music" propertystate, 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 Musicbe scene.configured.

(see

Create a new "OnEntry" action by pressing the below)"+" 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".

drawing-7-1676628442.pngdrawing-5-1696582410.png
drawing-7-1676628460.png

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.


drawing-5-1696582664.png

Add a "Handle Control StateState" Behavior to TextButton_Music and TextButton_NavigatioTextButton_Navigation node (which are in the Menu_button groupgroup). This can be done by drag-draging-and-dropdropping operation.the behavior from the Toolbox Behaviors panel

drawing-7-1676628477.pngdrawing-5-1696582957.png

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

drawing-7-1676628491.pngdrawing-5-1696583269.png

ClickSelect that State onin the State Machine Editor, and change Nameits onname 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 Navigation.what we did for the Music state.

drawing-5-1696586181.png

 

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

drawing-7-1676628510.pngdrawing-5-1696583747.png

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

drawing-7-1676628525.pngdrawing-5-1696584289.png
Transition Sender Textbutton_Music Event Clicked Condition Check Click Condition Parameters Sender Textbutton_Music Event AnyClick Condition 0

Music to Navigation

drawing-7-1676628603.png
Transition Sender Textbutton_Navigation Event Clicked Condition Check Click Condition Parameters Sender Textbutton_Navigation Event AnyClick Condition 0

SelectNow, Musicall Stateconfiguration is done. Please save your solution and add Transition Request behavior to On Entry Action/On Exit Action. After adding, set each behavior as shown in the table below.

drawing-7-1676628670.png
On Entry Action Action Transition Request RequestType Activate Identifiler /Scenes/IVI_Sample/Group2D:IVI_Sample/Group2D:Music On Exit Action Action Transition Request RequestType Deactivate Identifiler /Scenes/IVI_Sample/Group2D:IVI_Sample/Group2D:Music

Select Navigation State and take same operation.

drawing-7-1676628686.png
On Entry Action Action Transition Request RequestType Activate Identifiler /Scenes/IVI_Sample/Group2D:IVI_Sample/Group2D:Navigation On Exit Action Action Transition Request RequestType Deactivate Identifiler /Scenes/IVI_Sample/Group2D:IVI_Sample/Group2D:Navigation


Clickclick the Play button in the menu bar to run CGI Player.

Click
drawing-5-1696586565.png

 

The Player starts displaying the eitherMusic buttonscreen of(and Music/Navigationwe onare in Music state). Use the uppermenu partbuttons "Navigation" and "Music" to transitionswitch tobetween otherNavigation image.and Music.

drawing-7-1676628707.pngdrawing-5-1696587974.png