Creating a Title-screen menu 1

A Title-screen Menu is similar to the in-game Pause menu, only it's displayed in a specific scene, and invites the Player to click "New game" before continuing.

Just like our Pause menu, however, we still want to be able to access the Options, Load and Quit options, so we'll also need to add some logic to those menus in order to get them working with our new Title menu. This tutorial will assume that you already have a Pause menu with buttons for Options, Load and Quit beforehand - the 3D Demo comes with one, as will any Menu Manager created by the New Game Wizard (unless you opted to create a blank one).

Since our Title menu will be similar to the Pause menu, we'll copy it and use it as a basis. In the Menu Manager tab, click the cog button beside the Pause menu and click Copy.

The Paste menu button beneath the list of Menus will then become active. Click it to create a duplicate of the Pause Menu, and rename the new Menu from Pause (Copy) to Title.

We'll want this Menu to appear in a specific scene, so change it's Appear type to Manual. Make sure the Enabled on start? box is left unchecked.

Since this Menu will be shown at the very start of our game, we have no need for a Save button. From the list of the Menu's elements, click the cog button beside SaveButton and choose Delete.

The Resume button needs to be changed to a New Game button, so click on the ResumeButton element, rename it to NewGameButton, and change it's Button text to New game. Finally, set it's Click type to Run Action List.

We need to give it an ActionList to run when clicked, but since Menus work independently from scenes, we can't supply a scene-based ActionList like a Cutscene. Instead, we'll create an ActionList that lives in an asset file.

Create a new folder in your game's folder, and name it MenuActionLists. Inside this folder, create a Menu ActionList by choosing Create → Adventure Creator → ActionList in the Project window.

Name this new asset Begin new game.

We'll use this ActionList to close the Title menu, and then load our game's opening scene. In the Inspector for this file, create a Menu: Change state Action. Enter Title into the Menu to turn off box, and set the Change type to Turn Off Menu.

Later on, we'll be locking the Pause menu when this title scene begins so that it doesn't appear when pressing Escape. So, let's make sure it's unlocked now. Add a Menu: Change state Action to unlock it:

Then add a Scene: Switch Action, and enter the scene number or name of your game's introduction scene. In this example, we're loading the scene named "Intro".

Back in our Title Menu, set NewGameButton's ActionList to run as this new ActionList.

When the Options or Load buttons are clicked, the appropriate menus will crossfade in. However, they are set to crossfade back to the Pause menu when turned off. We will need to change this behaviour, so that these menus can be called by both the Title and the Pause menu.

Let's start with the Options menu. Select the menu, and then it's BackButton element. Change it's Click type to Turn Off Menu, and enable Do transition? so that it will fade out.

Notice that, in the list of the menu's properties, we can define an ActionList that runs when the menu is turned off. We will make use of this to turn on either the Pause or Title menu, based on which scene is currently loaded.

Just as before, create an ActionList asset, and name it Exit sub menu. At the top of its Inspector, set it's When running field to Run In Background:

Since we'll be making a query in this list, it's easier to use the ActionList Editor window, so click ActionList Editor in the asset's Inspector, and dock the window that appears.

Change the default Action to Scene: Check, and set Choose scene by to Name. Then enter in the name of the scene your title menu will be used in - in this case, it's TitleScreen.

If the condition stated is met (that is, we are currently in the TitleScreen scene), we want to enable the Title menu. Otherwise, we want to enable the Pause menu. Create two new Actions by dragging wires from the two output sockets (to the lower-right of the Action), and setting them to Menu: Change state.

Edit the Actions to turn on the Title and Pause menus respectively, checking Fade? in both.

The ActionList is now complete, so let's assign in. Back in our Menu Manager, set the Options menu's ActionList when turn off to Exit sub menu.

We now need to do the same for the Load menu - though we can re-use the ActionList asset. Select the Load menu's BackButton element, and again set the Click type to Turn Off Menu, and check Do transition?.

Then set the ActionList when turn off to Exit sub menu.

Now we are ready to display this Title menu in our scene. Create a new Cutscene set to run when the game begins by clicking Auto-create next to On start in the Scene Manager.

Create a Menu: Change state Action. Set the Change type to Lock Menu, and type Pause into the Menu to turn lock field.

This will prevent the Pause Menu from showing when we invoke the "Menu" input button (mapped to Escape by default).

Next, create another Menu: Change state Action. This time, leave the Change type as Turn On Menu, and type Title into the Menu to turn on box.

Our Title menu will now appear when the scene begins. Be sure to save the scene with the name we referenced in our Exit sub menu asset earlier (in this case, TitleScreen) - otherwise, the Options and Pause menus will not crossfade to the correct menu when closed.