ORK 4 RPG Framework Logo
  • ORK 4 GUIDE
    • Documentation
    • Tutorials
    • Extensions
    • API
  • ORK 3 GUIDE
    • Documentation
    • Tutorials
    • API
  • Support
  • Forum
  • Get ORK

ORK 4 Documentation

  • Getting Started
    • Welcome
    • First Steps (Unity)
  • Features
    • The Status System
    • Schematics
    • Schematic Nodes
    • Dialogue Importer
    • Variables
    • Selected Data
  • Components
    • Battle Components
    • Combatant Components
    • Control Components
    • Cursor Prefab Components
    • Game Starters
    • Interactable Components
    • Move AI Components
    • Scene Setup Components
  • Editor
    • The ORK 4 Editor
    • Sections & Sub-Sections
    • Node Editor
    • Schematic Editor
    • Asset Sources
    • Unity Overlay Toolbar
  • Section: System
    • System Settings
    • Languages
    • Organizer Types
    • Game States & Conditions
    • General Condition Templates
    • Object Pools
    • Prefab Savers
    • Scene Connections
  • Section: Controls
    • Game Controls
    • Interaction Settings
    • Player Controls
    • Camera Controls
    • Input Keys
    • Control Maps
    • Camera Positions
    • Battle Camera
  • Section: Gameplay
    • Game Settings
    • Formulas
    • Difficulties
    • Shortcut Slots & Settings
    • Custom Settings & Global Custom Settings
    • Global Machines
    • Machine Templates
  • Section: Status
    • Status Values
    • Status Effects
    • Attack Modifiers
    • Defence Modifiers
    • Abilities & Ability Developments
    • Status Developments
    • Research Trees
    • Damage Types
    • Status Bonuses & Templates
    • Status Condition Templates
  • Section: Inventory
    • Inventory Settings
    • Inventory Containers
    • Currencies
    • Items
    • AI Rulesets
    • Crafting Recipes
    • Equipment Slots & Slot Set Templates
    • Equipment & Available Equipment Templates
    • Shops
    • Loot
  • Section: Combatants
    • Combatants
    • Combatant Groups
    • Class Slots
    • Classes
    • Factions & Faction Benefits
    • Animations
    • Move AIs
    • Formations
    • Action Combos
  • Section: Battles
    • Battle Systems
    • Turn Based Battles
    • Active Time Battles
    • Real Time Battles
    • Phase Battles
    • Battle Spots
    • Battle AIs
    • Battle Actions Settings
    • Special Commands Settings
    • Target Settings
    • Target Selection Templates
    • Battle Range Templates
    • Battle Grid Settings
    • Battle Grid Highlights
    • Battle Grid Cell Types
    • Battle Grid Formations
  • Section: Content
    • Content Types
    • Music
    • Sound Templates
    • Areas
    • Teleports
    • Quests & Quest Tasks
    • Logs & Log Texts
    • Object Contents
  • Section: UI
    • UI Settings
    • UI Layers
    • UI Layouts
    • UI Boxes
    • HUDs
    • Notifications
    • Cursor Settings
  • Section: Menus
    • Start Menu
    • Save Game Settings
    • Option Categories
    • Menu Screens
    • Menu Requirements
    • Battle Menus
    • Loot Dialogues
    • Item Collection
    • Combatant Selections
    • Quantity Selections
    • Shop Layouts
  • Section: Texts
    • Text Settings
    • Formatting Settings
    • Flying Texts
    • Use Cost Display
    • Status Preview Display
    • Bonus Display
    • Status Change Display
    • Console Settings & Console Types
    • Text Codes
  • Sections: Editor
    • Editor Settings
    • Backups
    • Variables
    • Plugins
  • Scripting
    • Access Handler
    • Custom Nodes
    • Custom Save Data
    • Custom Component Save Data

ORK 4 Tutorials

  • ORK 4 Unity Quickstart Tutorials (3D)
    • ORK 4 Unity Quickstart 3D
    • 01 Initial ORK Setup
    • 02 Player Setup
    • 03 Music & Scenes
    • 04 UI System Setup
    • 05 UI Boxes
    • 06 Flying Texts
    • 07 Status Values
    • 08 Status Effects
    • 09 First Abilities
    • 10 Fighter Setup
    • 11 First Enemies & Battle AI
    • 12 Battle System Setup
    • 13 Animating Battle Start and End
    • 14 Random Battles
    • 15 Animating Actions
    • 16 Player Battle HUD
    • 17 Elemental Attacks
    • 18 Animating More Actions
    • 19 Inventory & Loot
    • 20 Equipment
    • 21 Loot, Start Equipment & Viewers
    • 22 Magic Abilities
    • 23 Caster Setup
    • 24 More Enemies
    • 25 Start Menu & Save Games
    • 26 Menu Screens
    • 27 Interactions
    • 28 Item Collectors
    • Quickstart Extended
  • Battle Tutorials
    • Active Time Battles
    • Phase Battles
    • Real TT 01 Real Time Battles & Tab Targeting
    • Real TT 02 Control Map, Use Ranges & Battle Area
    • Real TT 03 Camera Control, Battle AI & Reuse Time
    • Real TT 04 Damage Detection, Action Animation & Player HUD
    • Real TT 05 Switch Player & Final Adjustments
    • Hit & Miss
    • Critical Hits
    • Cast Time
    • Reuse Time
    • Grid 01: Battle Grid Setup
    • Grid 02: Highlights
    • Grid 03: Cell Types
    • Grid 04: Move Command
    • Grid 05: Scene Grid Setup
    • Grid 06: Battle Ready
    • Grid 07 Use & Affect Ranges
    • Grid 08: Better Camera Control
  • Gameplay Tutorials
    • Multiple Interaction Controllers
    • Player Group Spawn & Follow
    • Spawn Hunting Enemies
    • Gamepad Controls (Unity Input System)
    • Combined Inputs
    • Control Map for Keyboard (Shortcuts)
    • Control Map for Gamepad (Shortcuts)
    • Quests 01: Menu Screen
    • Quests 02: Hunting
    • Quests 03: Collect Potion Materials
    • Quests 04: Collect Equipment Materials
    • Quests 05: Quest Mark HUDs
    • Crafting 01: Menu Screen
    • Crafting 02: Materials & Recipes
    • Crafting 03: Getting Materials
    • Crafting 04: Proficiency & Critical Outcome
    • Shop
    • Inventory Containers
  • Schematics Tutorials
    • UI Animation Schematics
    • Flying Text Animation Schematics
    • HUD Conditional Schematics
  • UI Tutorials
    • Unity UI: Initial Setup
    • Unity UI: Status Value UI Setup
    • Unity UI: Status Effect UI Setup
    • Unity UI: Shortcut UI Setup
    • Unity UI: Dragging Notification
    • Unity UI: Interaction HUD
    • Unity UI: Shortcut HUD
    • Unity UI: Turn Order HUD
    • Unity UI: Cast Time HUD
    • Unity UI: Quest HUD
    • Unity UI: Tooltip HUD
    • Unity UI: Move Range HUD
    • Menus 01 UI Box Setup
    • Menus 02 Template HUDs
    • Menus 03 Menu Setup
    • Menus 04 Main Menu
    • Menus 05 Inventory
    • Menus 06 Equipment
    • Menus 07 Ability
    • Menus 08 Group
    • Menus 09 Quest
    • Menus 10 Crafting
  • Module 01: Status System
    • Introduction to Modular Tutorials
    • M01.1: Status Values
      • Introduction to Status Values
      • Health
      • Mana
      • Barrier
      • Base Experience
      • Class Experience
      • Spendable Experience
      • Normal Stats
    • M01.2: Modifiers
      • Introduction to Modifiers
      • Element
      • Attack Type
      • Size
      • Race
    • M01.3: Status Effects
      • Introduction to Status Effects
      • Buffs
      • Debuffs
      • Poison
      • Regeneration
      • Blind
      • Stun
      • Sleep
      • Silence
      • Enchants
      • Charm
      • Doom
      • Reflect
  • Module 02: Actions
    • Introduction to Actions
    • M02.1: Formulas
      • Introduction to Formulas
      • Physical Damage Formula
      • Magical Damage Formula
      • Hit Chance
      • Critical Chance
    • M02.2: Abilities
      • Introduction to Abilities
      • Base Attack
      • Elemental Magic Spells
      • Steal Ability
      • Drain
      • Healing Spell
      • Cure
      • Buff Abilities
      • Debuff Abilities

ORK 4 Extensions

  • Plugins
    • Save Game Compression Plugin
  • Schematic Nodes
    • Footstepper Nodes (Unity)
  • Scripts
    • A* Pathfinding Movement Component (Unity)
    • PolyNav 2D Movement Component (Unity)
    • Cinemachine Camera Control Type (Unity)
    • Rewired Input Key (Unity)
    • Unity Legacy Input Key (Unity)
    • Core GameKit Wrapper (Unity)
    • Pool Boss Wrapper (Unity)
View Categories
  • Guide
  • ORK 4
  • ORK 4 Tutorials
  • ORK 4 Unity Quickstart Tutorials (3D)

05 UI Boxes

0:00 / 12:23
  • View as Markdown Open this page as plain Markdown (opens in a new tab)
  • Open in ChatGPT Ask questions about this page (opens in a new tab)
  • Open in Claude Ask questions about this page (opens in a new tab)
  • Open in Google AI Studio Ask questions about this page (Google account required) (opens in a new tab)

In this tutorial we’ll continue the UI setup and create prefabs for UI boxes.

UI boxes are used to dispaly menus, dialogues and other notifications (but not for HUDs, except a Console HUD). They are, in short, a container to display content in.

We will set up all UI boxes we need for this tutorial series in one go – and since most of them will look the same, we mainly need to adjust positions and sizes. Additionally, we’ll set up a background UI for our menu.

UI Box Prefabs #

Setting up a UI box is pretty simple, you can create ready-to-use setups using the scene hierarchy’s context menu (ORK Framework > UI Box > UI Box (different variants available)) or the ORK toolbar (search for UI Box).

We’ll create our UI prefabs in the UI Environment Scene we set up. Remember to also remove the created objects from the Canvas afterwards to not have it part of our prefab scene.

Blue Center #

Our first UI box will be displayed in the center of the screen and use a blue box image (as will most of our UI boxes).

Create a UI box with vertical scrolling and a title box using scene hierarchy’s context menu: ORK Framework > UI Box > UI Box Scroll Vertical with Title

This’ll create a UI box that looks like this:

And has a structure like this:

We’ll now adjust the UI box to our needs.

Image #

First, we change the background image of the UI Box object and UI Box > Title Content child object.

This is done in the Image component attached to the objects – the setup for both is the same.

  • Source Image
    Select: BoxBlue
    You can find it in Assets/Tutorial Assets/Images/UI/.
  • Color
    Select a white color with full alpha (e.g. A=1 or A=255, depending on your color picker).

Rect Transform #

Select the UI Box object again – we’ll now adjust the size of the UI box in the Rect Transform component.

  • Width
    Set to: 400
  • Height
    Set to: 400

Scrollbar (Optional) #

The scrollbar is currently a bit too big, let’s size it down a little.

Select the UI Box > Scroll View > Scrollbar Vertical child object and adjust the Rect Transform component.

  • Pos X
    Set to: -5
  • Top
    Set to: 5
  • Width
    Set to: 10
  • Bottom
    Set to: 5

Content Padding (Optional) #

The content of the UI box and title box is currently a bit close to the edges of their box. Let’s adjust that.

Select the UI Box > Scroll View > Viewport > Content child object, we’ll change the Vertical Layout Group component.

  • Padding
    Set to: Left=10, Right=10, Top=10, Bottom=10
  • Spacing
    Set to: 10

And once more for the title box, select the UI Box > Title Content child object, this time we’ll change the Horizontal Layout Group component.

  • Padding
    Set to: Left=10, Right=10, Top=10, Bottom=10
  • Spacing
    Set to: 10

And with that, the UI box should now look like this:

Create Prefab #

Create a prefab out of the UI Box object by dragging it into the project view, e.g. name it UI Box Blue Center.

Don’t forget to remove the UI Box from the Canvas object when creating in your UI Environment Scene.

Tip!

Keep your project’s assets organized and put your UI box prefabs in a separate folder somewhere – e.g. I put my prefabs into Assets/UI/UI Boxex/.

Battle Menu #

For most of the remaining UI boxes (except the last two), we’ll only adjust the position and size.

Create a copy of the prefab you just created and rename the new prefab to UI Box Battle Menu. Open the new prefab for editing, e.g. by double clicking on it.

Rect Transform #

All we need to do is change the settings of the Rect Transform component on the root UI Box object.

Change the settings in the following order.

Select the bottom left anchor preset.

  • Pivot
    Set to: X=0, Y=0
  • Pos X
    Set to: 0
  • Pos Y
    Set to: 0
  • Width
    Set to: 400
  • Height
    Set to: 300

Save the changes you’ve made to the prefab.

Menu Small #

Create a copy of the UI Box Blue Center prefab and rename the new prefab to UI Box Menu Small. Open the new prefab for editing.

Rect Transform #

Again, we change the settings of the Rect Transform component on the root UI Box object.

We only change the position, the size (400×400) and anchor preset (middle center) stay as they are.

  • Pos X
    Set to: -600
  • Pos Y
    Set to: 200

Save the changes you’ve made to the prefab.

Menu Info #

Create a copy of the UI Box Blue Center prefab and rename the new prefab to UI Box Menu Info. Open the new prefab for editing.

Rect Transform #

Like before, we’ll only change the position.

  • Pos X
    Set to: 600
  • Pos Y
    Set to: -200

Save the changes you’ve made to the prefab.

Menu Big #

Create a copy of the UI Box Blue Center prefab and rename the new prefab to UI Box Menu Big. Open the new prefab for editing.

Rect Transform #

This time we only change the size to make it bigger, while keeping it in the center of the screen.

  • Width
    Set to: 800
  • Height
    Set to: 800

Save the changes you’ve made to the prefab.

Dialogue #

The dialogue will be a bit different, as we’ll also change the used background image (beige box) and change the font color.

We still base it on our first UI box, create a copy of the UI Box Blue Center prefab and rename the new prefab to UI Box Dialogue. Open the new prefab for editing.

Rect Transform #

We’ll start with changing the position and size of the Rect Transform component on the root UI Box object.

Change the settings in the following order.

Select the bottom center anchor preset.

  • Pivot
    Set to: X=0.5, Y=0
  • Pos X
    Set to: 0
  • Pos Y
    Set to: 100
  • Width
    Set to: 600
  • Height
    Set to: 200

Image #

As with our first UI box, we change the Image component on the root UI Box object and UI Box > Title Content child object.

The setup for both is the same.

  • Source Image
    Select: BoxBeige

TextMeshPro – Text (UI) #

And we’ll change the font color of the content and title.

This is done on the TextMeshPro – Text (UI) components on the UI Box > Scroll View > Viewport > Content > Text child object (for the main content) and the UI Box > Title Content > Text child object (for the title content).

  • Vertex Color
    Select a black color with full alpha (e.g. A=1 or A=255, depending on your color picker).

Save the changes you’ve made to the prefab.

Action Info #

For our final UI box, we’ll create a new one from scratch. This time, the UI box should adjust to the content it displays – we don’t use scrolling or a title.

Close the prefab editing and create a UI box using scene hierarchy’s context menu (in the UI Environment Scene): ORK Framework > UI Box > UI Box Fit Size

We’ll use this UI box to display the name of the action a combatant will use during battle. It’s position will be based on the combatant’s on-screen position, and the size adjust to the displayed content.

Image #

The UI box will also be beige, change the Image component on the root UI Box object.

  • Source Image
    Select: BoxBeige
  • Color
    Select a white color with full alpha (e.g. A=1 or A=255, depending on your color picker).

Vertical Layout Group #

We’ll adjust the padding.

  • Padding
    Set to Left=20, Right=20, Top=20, Bottom=15.

Content Size Fitter #

This component handles adjusting the size to the displayed content. We’ll adjust both horizontal and vertical.

  • Horizontal Fit
    Select Preferred Size.
  • Vertical Fit
    Select Preferred Size.

TextMeshPro – Text (UI) #

As before, we change the text color to a black color. This is done on the TextMeshPro – Text (UI) components on the UI Box > Text child object.

  • Vertex Color
    Select a black color with full alpha (e.g. A=1 or A=255, depending on your color picker).

Create Prefab #

Create a prefab out of the UI Box object by dragging it into the project view, e.g. name it UI Box Action Info.

Don’t forget to remove the UI Box from the Canvas object when creating in your UI Environment Scene.

UI Background Prefab #

We’ll create another UI prefab – this time a background for our menus.

As usual, we can easily set this up using the scene hierarchy 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 about 4/5 filled alpha value (e.g. A=0.8 or A=200, depending on the color picker).

Create Prefab #

Create a prefab out of the Background game object by dragging it into the project view, e.g. name it Menu Background.

Don’t forget to remove the game object from the canvas.

UI Boxes General Settings #

With our UI box prefabs finished, we can now set up our UI boxes in the editor.

First, we’ll set up some general settings for all UI boxes, e.g. UI audio and how input is handled. Individual UI boxes can also override these settings, if needed (but we don’t need it for this tutorial series).

Open the ORK editor and navigate to UI > UI Boxes and select the General Settings.

Default Controls #

These settings handle which input keys are used to control the UI (e.g. accepting or canceling, selecting a button, etc.).

We can keep most of the settings, but will set our input selections to loop, e.g. going down from the last selected input returns to the first input.

Input Settings #

  • Loop
    Enable

Default Audio Settings #

You can find all used audio clips in Assets/Tutorial Assets/NinjaAdventure/Sounds/Menu/.

  • Cursor Move
    Select: switch37
  • Accept
    Select: switch38
  • Cancel
    Select: switch34
  • Fail
    Select: interface6
  • Fail Volume
    Set to: 0.4
    The audio clip is a bit loud, so we’ll reduce the volume it’ll be played with.
  • Value Input Change
    Select: switch37
  • Change
    Select: switch37
  • Tab Change
    Select: switch37
  • Page Change
    Select: switch37

Default Inactive Colors #

Inactive colors are used to tint unfocused UI boxes, e.g. making them darker or semi-transparent. Only one UI box has the active focus and can be controlled at a time, these settings help making clear which one is controlled to the player.

  • Set Color
    Enable

I’ll stick to the default Color (a gray color with full alpha value), but you can change it to your liking.

Default Schematics #

We’ll use the schematics we’ve set up to fade in and fade out our UI boxes.

  • Open Schematic
    Select: UIFadeIn
  • Wait
    Enable
    This’ll wait for the schematic to finish before considering the UI box open (e.g. allowing controls).
  • Close Schematic
    Select: UIFadeOut
  • Wait
    Enable.
    This’ll wait for the schematic to finish before considering the UI box closed (e.g. finish closing a menu screen or continuing a schematic after a dialogue closed).

UI Boxes #

Finally, we’ll set up UI boxes and use our prefabs.

Navigate to UI > UI Boxes and select the Default UI box. We’ll change it and also add the rest of the UI boxes.

0: Blue Center #

  • Name
    Set to: Blue Center
  • UI Layer
    Select: Layer 1

Unity UI #

Since we’re using the Unity UI module, we’ll use the prefab we created.

  • UI Box Prefab
    Select: UI Box Blue Center

1: Battle Menu #

The rest of the UI boxes are just copies with changed name and prefab.

Copy the Blue Center UI Box and change the following settings.

  • Name
    Set to: Battle Menu
  • UI Box Prefab
    Select: UI Box Battle Menu

2: Menu Small #

Copy the Battle Menu UI Box and change the following settings.

  • Name
    Set to: Menu Small
  • UI Box Prefab
    Select the UI Box Menu Small prefab.

3: Menu Info #

Copy the Menu Small UI Box and change the following settings.

  • Name
    Set to: Menu Info
  • UI Box Prefab
    Select: UI Box Menu Info

4: Menu Big #

Copy the Menu Info UI Box and change the following settings.

  • Name
    Set to: Menu Big
  • UI Box Prefab
    Selec: UI Box Menu Big

5: Dialogue #

Copy the Menu Big UI Box and change the following settings.

  • Name
    Set to: Dialogue
  • UI Box Prefab
    Select: UI Box Dialogue

6: Action Info #

Copy the Dialogue UI Box and change the following settings.

  • Name
    Set to: Action Info
  • UI Box Prefab
    Select: UI Box Action Info

Save Changes #

And that’s it for now.

Save the changes using the Save Settings button at the bottom of the editor.

 

Next, we’ll set up flying texts (e.g. used for damage numbers).

Table of Contents
  • UI Box Prefabs
    • Blue Center
      • Image
      • Rect Transform
      • Scrollbar (Optional)
      • Content Padding (Optional)
      • Create Prefab
    • Battle Menu
      • Rect Transform
    • Menu Small
      • Rect Transform
    • Menu Info
      • Rect Transform
    • Menu Big
      • Rect Transform
    • Dialogue
      • Rect Transform
      • Image
      • TextMeshPro - Text (UI)
    • Action Info
      • Image
      • Vertical Layout Group
      • Content Size Fitter
      • TextMeshPro - Text (UI)
      • Create Prefab
  • UI Background Prefab
    • Image
    • Create Prefab
  • UI Boxes General Settings
    • Default Controls
      • Input Settings
    • Default Audio Settings
    • Default Inactive Colors
    • Default Schematics
  • UI Boxes
    • 0: Blue Center
      • Unity UI
    • 1: Battle Menu
    • 2: Menu Small
    • 3: Menu Info
    • 4: Menu Big
    • 5: Dialogue
    • 6: Action Info
    • Save Changes
Sitemap
  • Showcase
  • ORK 4 Guide
    • Documentation
    • Tutorials
    • Extensions
    • API
  • ORK 3 Guide
    • Documentation
    • Tutorials
    • API
  • ORK 2 Hub
    • Tutorials
    • Plugins
    • API
  • Support
  • Forum
  • Get ORK
  • Contact
  • Blog
  • Makinom
  • gamingislove.com
Categories
  • News (75)
  • ORK 2 (137)
    • Tutorial (137)
      • Game tutorial (50)
      • Gameplay (32)
      • How-to (55)
  • Release (158)
Search

© 2015 Gaming is Love e.U.

Disclosure: This site may contain affiliate links, which means I may receive a commission if you click a link and purchase something that I have recommended. While clicking these links won’t cost you any money, they will help me fund my development projects while recommending great assets!