Before we go any deeper into ORK Framework, we need to set up the main menu of your game – it’s the starting point for every test we’ll run!

The main menu (and every other menu or dialogue) uses GUI boxes to display it’s content, so we need to set up a GUI box first. Let’s start by opening the ORK Framework editor using the Unity® menu: Window > ORK Framework.

Some default settings first

First, we’ll define the Default Screen Size we’ll use for all UI. Navigate to the Game section of the ORK Framework editor and open the Game Settings and change the following setting.

  • Default Screen Size
    Set this to X=1280, Y=800.

Before we create our GUI box and main menu, we’ll also define the default GUI Skins and Audio Settings. This default settings can be overridden by each GUI box individually.

GUI Skins are a Unity® feature used to define the look of GUI elements. You can find the GUI skins used in this tutorial in the project tab in: Assets/Tutorial Recourses/Skins

The Audio Settings define the sounds when controlling a GUI box (like moving the cursor/selection or accepting/canceling). You can find the sound files used in this tutorial in the project tab in: Assets/Tutorial Resources/Audio

Navigate to the Menus > Menu Settings and change the following settings.

Default GUI Skins

Since there seems to be a bug in Unity that doesn’t display GUISkins when clicking on the field, you’ll have to drag the used GUISkins on the fields.

  • Base Skin
    Drag the GUISkin BaseSkin on this field.
  • Selected Choice
    Drag the GUISkin SelectSkin on this field.
    This skin is used to highlight a selected choice.

Default Audio Settings

  • Cursor Move
    Select cursor01.
    This sound is played when you change the selection in a choice dialogue/menu.
  • Accept
    Select accept01.
    This sound is played when accepting a choice or dialogue.
  • Cancel
    Select cancel01.
    This sound is played when canceling.
  • Fail
    Select fail01.
    This sound is played when you try to accept an inactive choice.
  • Ability Level Change
    Select cursor01.
    This sound is played when you change the level of an ability (in menus).
  • User Change
    Select accept01.
    This sound is played when you change the user of a menu.

That’s it for the default settings, now we’re ready to create a GUI box.

Setting up a GUI box

Navigate to Menus > GUI Boxes. You’ll see that a GUI box is already available and selected – we’ll edit this one. Change the following settings.

Base Settings

  • Name
    Change the name to Main Menu.
    It’s crucial to give recognizable names to your data to distinguish them later.
  • Height Adjustment
    Select Auto.
    This will automatically enlarge or collapse the height of the GUI box to it’s content.

Content Box Settings

  • Bounds
    Set X=640, Y=400, W=200 and H=200.
    This position (X, Y) is at the center of the screen – the default screen size is set to 1280×800.
  • Anchor
    Select Middle Center.
    This means that the center of the GUI box will be displayed at the position defined in bounds – the main menu will be displayed at the center of the screen.

The main menu GUI box is finished for now, click on Save Settings and save the changes you made. You’ll be prompted with a list of all parts that will change when saving – since this is the first time saving, the list is quite long. Confirm saving.

Setting up the main menu

Navigate to Menus > Main Menu (section > sub-section). Now we’ll set up the choices we’ll have in the main menu and some other settings. Change the following settings.

Base Settings

  • Main Menu Scene
    Set to 0 Main Menu (the name of the scene we want the main menu to be displayed).
    This setting is used to return to the main menu scene when quitting a game.
  • Auto Call
    Enable this setting.
    The main menu will automatically be called in the main menu scene.

New Game Settings

  • New Game Scene
    Set to 1 Town.
    This setting tells ORK which scene should be loaded when starting a new game.

Menu Options

  • GUI Box
    Select the main menu GUI box we just created.
    This GUI box will be used to display the main menu.
  • New Game Button
    Set the text of the button to New Game (or however you want to name it).
  • Load Button
    Set the text of the button to Load Game (or however you want to name it).
  • Show Language
    Disable this setting.
    We don’t need a language button in our game.
  • Show About
    Disable this setting.
    We don’t need an about button in our game.
  • Exit Button
    Set the text of the button to Exit (or however you want to name it).

Ignore the rest of the settings and click on Save Settings. Confirm saving.

Testing

Open the main menu scene (0 Main Menu) and hit play – you should now see the main menu you just created.

gametutorial_2_the_main_menu1

And that’s it for now – the next lesson will cover getting a player into your game.