Part 5: Count Received Calls
ThisPart chapter5 describesexplains how to count the receivedincoming calls and display them in the Main Menu Scene.scene. ToThe achievenumber this,of incoming calls is the Statenumber Machineof willtimes sendthe text “Incoming Call” set in Part 4 is displayed. The result is sent to the TextNode of the Main Menu scene as an event with a relative value as event tovia the TextNodeState in Scene Main Menu.Machine.
Incoming
Adding a TextNode
]Add TextNode to
The Main Menu scene will be displayed in the Scene Tree panel.Drag and drop athe TextNodeText Node from the ToolBox[Node into2D] in the Toolbox panel onto the Main Menu scene in the Scene Tree.

Open the TextBox's properties and configure its position. The textText of the TextNodeNode will be set via a Behavior, which is explaineddisplayed in sectionthe ConfigureScene BehaviorsEditor as "Text".
Set the following properties for TextNode.the added Text Node in the Properties panel.

Y 0 2D Text Node>Text Received Calls: %d
OnEntry Settings
Double-click IncomingCall_StateMachine in the [ State Machines ] folder in the Solution Explorer.
The MainState MenuMachine SceneEditor will lookbe like this now.displayed.

Configure Active State
OpenWith the IncomingCall_StateMachineCallActive inState selected, click [ Fusion ] at the bottom left of the State Machine Editor panel.
The Fusion panel for the CallActive State will be displayed.
Drag the [ On Entry Actions ] connector on the right of the CallActive Fusion node and move the mouse.
A link will appear as you move the mouse, so release the left mouse button at the any location.
Select “Action > Property > Send Value As Event” from the list and connect it to the top node.
The settings in the table below are made for the connected Send Value As Event.
When the CallActive State is entered, a relative value (Relative) 1 is sent to the TextNode that was just added.

Adding a TextNode
Double-click IncomingCall_StateMachine in the [ State Machines ] folder in the Solution Explorer. Select
The State andMachine addEditor anotherwill OnEntrybe Actiondisplayed.
Drag the [ Behaviors ] connector on the right of the TextNode Fusion node and move the mouse.
A link will appear as you move the mouse, so release the left mouse button at the any location.
Select “Value Processing > Value” from the list and connect it to OnEntry.the top node.
Configure
Drag the Call[ ActiveReceivers State.] The relative value 1 shall be sent to the TextNode in Scene MainMenu.

To select the TargetNode clickconnector on the magnifying glass icon and select the TextNode of Scene MainMenu in the Choose Item dialog.

We have now configured the State to send a value. The next step is to configure the TextNode to receive the value.
Configure Behaviors for TextNode
Select the TextNode in the Scene Tree Panel. Drag and drop a Value Behavior from the ToolBox Controls into the right side of the Scene Tree Panel below Behaviors. This Behavior is the Behavior to receive the values from the received calls.

Drag and drop a Format String behavior onto the Receivers of the Value Behavior.Behavior Fusion node and move the mouse.

Select “Value Processing > Format String” from the Formatlist Stringand behaviorconnect it to the top node.
Enter “Received Calls: %d” in the [ Text ] of the Format String Behavior Fusion node.

Verifying Action
Use the Player to check the operation of the configuration you have set in the previous section.
Checking the incoming call count operation
By pressing the Enter key on the keyboard, the text
Received Calls: %d%dCall” will 
Test
Pressing the Savehides yourthe solution“Incoming Call” text displayed on the screen.

After the Player is opened,result, you can seeconfirm the Navigation Scene, on the right side you can see the new "Received Calls" TextNode.

When Pressing the Key_RightArrow, the transition to the Media scene is performed and the selected device is the default device "Radio".

If you press the Key_Enter, the Incoming Calls Scene gets visible, the Media Scene is still displayed in the background andthat the number of receivedincoming calls inis being counted correctly.
