Adding UI widgets to game levels
UI widgets can be created and added to the viewport of the current game level, but the preferred place to create UI widgets is in Level Blueprints. So, click on the List of World Blueprints button on the toolbar and choose Open Level Blueprint to open and edit the Level Blueprint:
Figure 11.12 – Opening the current Level Blueprint
Next, open LobbyMap and edit the Level Blueprint as follows:
- Search for and add a Create Widget node to the graph. The new node’s title only displays Construct NONE at the moment.
- Select BP_LobbyWidget from the Class drop-down menu. The Create Widget node’s title will now display Create BP Lobby Widget Widget.
- Add a Add to View Port node and connect the output pin of the Create BP Lobby Widget Widget node to the input pin of Add to View Port node. Connect the execution pins of these two nodes as well:
Figure 11.13 – Creating...