In this tutorial we’ll set up UI boxes for our menu system.
This tutorial is the start of a mini-series covering menu screens.
Parts 01, 02, 03 and 04 are mandatory, the rest of the tutorials can be used or not, based on your needs, as each of the other tutorials will add a single menu screen covering a feature or system (e.g. inventory, equipment and abilities).
Menu screens are used to manage inventory, abilities, the player group and more.
Before we’ll get to setting up the actual menu screens, we’ll need to set up some UI boxes we’ll use. We’ll set up the following UI boxes:
- small content fitting in the top left
- small content fitting in the top right
- small content fitting in the bottom left
- small content fitting in the bottom right
- large scrollable in the center
- large scrollable in the center, with tabs
- scrollable in the top half of the screen
- scrollable in the bottom half of the screen
We’ll also set up a UI background that’ll be displayed with our menu screens – we’ll just display a black color.
This tutorial is based on the ORK 4 Unity Quickstart 3D tutorials, but can be used in any project. Your project’s UI system should already be set to Unity UI. If not, check the initial setup tutorial for Unity UI.
As with all content when using Unity UI, we’ll set up prefabs. It’s best to do this in the UI Environment Scene, so open it.
Prefabs Setup #
We’ll start with setting up the UI prefabs.
UI Background #
Create a ready-to-use setup either using the scene hierarchy’s context menu (ORK Framework > UI > Background (Sprite)) or the ORK toolbar (search for: Background Sprite).
This’ll create a UI background a bit larger than the canvas, we just need to adjust the Image component.
Image #
- Source Image
Select: White_16x16 - Color
Select a black color with full alpha value.
The result should look like this:
Create a prefab out of the Background game object, e.g. name it Menu Full Background.
We’ll handle the background setup for our menu screens (i.e. using the prefab) in a later part of the tutorial series.
Top Left Fit #
Create a new UI box either using the scene hierarchy’s context menu (ORK Framework > UI Box > UI Box Fit Size with Title) or the ORK toolbar (search for: UI Box Fit Title).
This UI box variant will have a Content Size Fitter component attached, that fits the the vertical size (height) to the displayed content.
Rect Transform #
We’ll adjust the position and size of the UI box.
Use the top left anchor presets.
- Pivot
Set to: X=0, Y=1 - Pos X
Set to: 200 - Pos Y
Set to: -200 - Width
Set to: 400
Image #
We’ll change the used sprite and color of the Image components on the UI Box object and Title Content child object. Select both and change the following settings:
- Image Source
Select: BoxBlue - Color
Select a white color with full alpha value.
It should now look something like this.
Create a prefab #
Create a prefab out of the UI box and save it as UI Box Blue Top Left Fit.
Bottom Left Fit #
Duplicate your UI Box Blue Top Left Fit prefab and rename the copy to UI Box Blue Bottom Left Fit.
Open it for editing and change the following settings (in this order).
Rect Transform #
Use the bottom left anchor presets.
- Pivot
Set to: X=0, Y=0 - Pos X
Set to: 200 - Pos Y
Set to: 200 - Width
Set to: 400
Save the changes to the prefab.
Top Right Fit #
Duplicate your UI Box Blue Top Left Fit prefab and rename the copy to UI Box Blue Top Right Fit.
Open it for editing and change the following settings (in this order).
Rect Transform #
Use the top right anchor presets.
- Pivot
Set to: X=1, Y=1 - Pos X
Set to: -200 - Pos Y
Set to: -200 - Width
Set to: 400
Save the changes to the prefab.
Bottom Right Fit #
Duplicate your UI Box Blue Top Left Fit prefab and rename the copy to UI Box Blue Bottom Right Fit.
Open it for editing and change the following settings (in this order).
Rect Transform #
Use the bottom right anchor presets.
- Pivot
Set to: X=1, Y=0 - Pos X
Set to: -200 - Pos Y
Set to: 200 - Width
Set to: 400
Save the changes to the prefab.
Center Scroll #
We’ll create a new UI box from scratch.
Create a new UI box either using the scene hierarchy’s context menu (ORK Framework > UI Box > UI Box Scroll Vertical with Title) or the ORK toolbar (search for: UI Box Vertical Title).
Rect Transform #
Use the middle center anchor presets.
- Pivot
Set to: X=0.5, Y=0.5 - Pos X
Set to: 0 - Pos Y
Set to: 0 - Width
Set to: 720 - Height
Set to: 680
Image #
We’ll change the used sprite and color of the Image components on the UI Box object and Title Content child object. Select both and change the following settings:
- Image Source
Select: BoxBlue - Color
Select a white color with full alpha value.
It should now look something like this.
Create a prefab #
Create a prefab out of the UI box and save it as UI Box Blue Menu Center Scroll.
Tab Center Scroll #
Duplicate your UI Box Blue Menu Center Scroll prefab and rename the copy to UI Box Blue Menu Tab Center Scroll.
Open it for editing and change the following settings.
Adding Tabs #
We’ll add a tab area (to display the tab buttons in), have the root UI Box object selected.
Either use the scene hierarchy’s context menu (ORK Framework > UI Box > Tab > UI Box: Add Tabs Top (Scroll Horizontal)) or ORK toolbar (search for: Tabs Top Horizontal).
This’ll add child object where our tabs will be added to – they’re scrollable horizontally (without displaying a scrollbar). The area is added to the top of the UI box, moving the scroll rect down a bit. We’ll adjust the positioning a bit, making the tab area higher.
Tabs Rect Transform #
Select the UI Box > Tabs child object (should already be selected by creating it).
- Height
Set to: 70
Content Scroll Rect Transform #
Select the UI Box > Scroll View child object.
- Top
Set to: 70
The result should look like this:
Save the changes to the prefab.
Top Scroll #
Duplicate your UI Box Blue Menu Center Scroll prefab and rename the copy to UI Box Blue Menu Top Scroll.
Open it for editing and change the following settings (in this order).
Rect Transform #
Use the middle center anchor presets.
- Pivot
Set to: X=0.5, Y=0 - Pos Y
Set to: 0 - Height
Set to: 340
Save the changes to the prefab.
Bottom Scroll #
Duplicate your UI Box Blue Menu Top Scroll prefab and rename the copy to UI Box Blue Menu Bottom Scroll.
Open it for editing and change the following settings (in this order).
Rect Transform #
Use the middle center anchor presets.
- Pivot
Set to: X=0.5, Y=1 - Pos Y
Set to: 0
Save the changes to the prefab.
That’s it for the prefabs.
In total, the menu UI boxes and background will look like this:
UI Box Setup #
With out prefabs ready to use, we’ll set up the UI boxes in the editor.
Open the ORK editor and navigate to UI > UI Boxes. We’ll add multiple new UI boxes.
UI Boxes General Settings #
Navigate to UI > UI Boxes > General Settings, we’ll now set up tab controls and audio.
UI Box Top Left Fit #
Add a new UI box.
Base Settings #
- Name
Set to: Blue Top Left Fit - UI Layer
Select: Layer 1
Unity UI #
- UI Box Prefab
Select: UI Box Blue Top Left Fit
Override Default Settings > Schematics #
I’m also using the move from left and move to left schematics from the UI animations schematics to animate this UI box.
- Own Schematics
Enable - Open Schematic
Select: UIMoveInFromLeft - Wait
Enable - Close Schematic
Select: UIMoveOutToLeft - Wait
Enable
UI Box Bottom Left Fit #
Copy the Blue Top Left Fit box and change the following settings.
Base Settings #
- Name
Set to: Blue Bottom Left Fit
Unity UI #
- UI Box Prefab
Select: UI Box Blue Bottom Left Fit
UI Box Top Right Fit #
Copy the Blue Top Left Fit box and change the following settings.
Base Settings #
- Name
Set to: Blue Top Right Fit
Unity UI #
- UI Box Prefab
Select: UI Box Blue Top Right Fit
Override Default Settings > Schematics #
I’m changing to the move from right and move to right schematics.
- Open Schematic
Select: UIMoveInFromRight - Close Schematic
Select: UIMoveOutToRight
UI Box Bottom Right Fit #
Copy the Blue Top Right Fit box and change the following settings.
Base Settings #
- Name
Set to: Blue Bottom Right Fit
Unity UI #
- UI Box Prefab
Select: UI Box Blue Bottom Right Fit
UI Box Menu Center Scroll #
Copy the Blue Bottom Right Fit box and change the following settings.
Base Settings #
- Name
Set to: Blue Menu Center Scroll
Unity UI #
- UI Box Prefab
Select: UI Box Blue Menu Center Scroll
Override Default Settings > Schematics #
I’ll use the default schematics
- Own Schematics
Disable
UI Box Menu Tab Center Scroll #
Copy the Blue Menu Center Scroll box and change the following settings.
Base Settings #
- Name
Set to: Blue Menu Tab Center Scroll
Unity UI #
- UI Box Prefab
Select: UI Box Blue Menu Tab Center Scroll
UI Box Menu Top Scroll #
Copy the Blue Bottom Right Fit box and change the following settings.
Base Settings #
- Name
Set to: Blue Menu Top Scroll
Unity UI #
- UI Box Prefab
Select: UI Box Blue Menu Top Scroll
Override Default Settings > Schematics #
I’m changing to the move from above and move to above.
- Open Schematic
Select: UIMoveInFromAbove - Close Schematic
Select: UIMoveOutToAbove
UI Box Menu Bottom Scroll #
Copy the Blue Menu Top Scroll box and change the following settings.
Base Settings #
- Name
Set to: Blue Menu Bottom Scroll
Unity UI #
- UI Box Prefab
Select UI Box Blue Menu Bottom Scroll.
Override Default Settings > Schematics #
I’m changing to the move from below and move to below.
- Open Schematic
Select: UIMoveInFromBelow - Close Schematic
Select: UIMoveOutToBelow
Save Changes #
And that’s it!
Don’t forget to save your changes by clicking on Save Settings at the bottom of the editor.
The next part of the menus mini-series will set up HUDs used as templates.







