ORK Framework Logo - RPG Editor for Unity
  • ORK 4 BETA
  • Features
  • Guide
    • Documentation
    • Tutorials
    • API
  • ORK 2
    • Tutorials
    • Plugins
    • 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
    • Hit & Miss
    • Critical Hits
    • Cast 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
    • 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

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
  • UI Tutorials

Unity UI: Initial Setup

In this tutorial we’ll go through the initial setup for using the Unity UI system.

Change the UI System #

First, you need to change the used UI system of your ORK project. Learn more about UI systems in this documentation.

Open the ORK editor and navigate to UI > UI Settings.

UI System Settings #

  • UI System Type
    Select: Unity UI
  • Default Screen Size
    Set up the screen size you want to use, or rather, you design your UI for.
    This is e.g. used when creating a canvas for setting up UI prefabs or in-game (when the UI layers don’t use their own custom canvas prefabs).
    The default is: X=1920, Y=1080

Save the changes using the Save Settings button at the bottom of the editor. Please note that changing the UI system will also impact other settings that use UI settings.

TextMesh Pro Setup #

If you haven’t done so, import the TMP Essential Assets into your Unity project.

You can import them via the Unity menu: Window > TextMeshPro > Import TMP Essential Resources

Depending on your Unity/TMP version this might also be located somewhere else.

TMP Settings #

If you want to change the default font or icon sprites used by TMP, you can find the TMP settings in Assets/TextMesh Pro/Resources/.

Creating Own Fonts and Icons #

TMP uses special font and icon assets – you can create them easily from regular fonts and sprites (usually using spritesheets) via the context menu in the project hierarchy tab.

TMP Font Asset #

To create a TMP font asset from a font in your project, right-click on the font and select: Create > TextMeshPro > Font Asset

TMP Sprite Asset #

Similar, to create a TMP sprite asset from a sprite in your project, right click on the sprite and select: Create > TextMeshPro > Sprite Asset

You might need to adjust the positioning of your sprites, this is best handled via the Sprite Glyph Table settings of the TMP sprite asset. Adjusting the OX and OY settings will change all included sprites.

Location #

When not used as default font/icons, the TMP font/sprite assets need to be placed in defined sub-folders of a Resources folder.

Those folders are defined in the TMP Settings asset and default to Fonts & Materials (for fonts) and Sprite Assets (for sprites).

UI Enviroment Scene #

When editing UI prefabs, Unity will use a canvas that is most likely not matching the canvas used in your game. This can lead to your prefab’s position and size not matching the in-game’s position and size.

To solve this issue, set up a UI Environment scene with a correctly set up canvas matching your Default Screen Size set up in ORK’s UI settings.

Creating the scene #

After setting your Default Screen Size (or after changing it), create a new scene using the Unity menu (File > New Scene) and create an empty scene.

Use the scene hierarchy’s context menu to create a canvas with the correct setup: ORK Framework > UI > Canvas

Or use the ORK toolbar, search for Canvas.

This’ll create a Canvas with the same set up as it’d be in the running game (when not using a canvas prefab), i.e. it’ll use a Canvas Scaler to scale content to different resolutions and aspect ratios.

Save the scene somewhere in your project, e.g. as UI Environment Scene.

Setting up the UI Environment scene #

Use the Unity menu to open the project settings: Edit > Project Settings…

Select the Editor tab and change the following setting.

  • UI Environment
    Select: UI Environment Scene

Close the project settings.

Now, when editing a UI prefab, e.g. a UI box or an input prefab, they’ll use this scene and it’s canvas, making sure that their placement and size remains correct.

Default Input Prefabs #

Next, we’ll create the default input prefabs (i.e. buttons, toggles, etc.).

The default input prefabs are used as fallbacks, in case no other UI prefab is defined for an input (e.g. by a UI box or the content definition of a dialogue or menu). When inputs are displayed in a UI box, they’re created from prefabs to define how they look or interact – the content is coming from whatever is displaying the UI box.

Creating the Prefabs #

With the UI Environment Scene open, use the scene hierarchy’s context menu (ORK Framework > UI Box > Create Default Inputs) or ORK toolbar (search for: Create Default Inputs).

This’ll create one of each input and parent them to the canvas. All that’s left to do is create the prefabs out of them by dragging them into a folder in Unity’s project hierarchy.

E.g. I’ll save my input prefabs here: Assets/UI/Inputs/

You can select all inputs in the scene hierarchy and drag them into the folder, this’ll create individual prefabs for each input.

Using the Prefabs #

Open the ORK editor and navigate to UI > UI Settings in the editor and change the following settings.

UI System Settings > Default UI Prefabs #

  • Button Prefab
    Select: Choice Info Button
    For ORK, it’s recommended to use a Choice Info Button variant, as you often want to display additional content (e.g. item quantity, use costs, etc.).
    If no additional content is displayed, it’ll simply not be displayed in the button.
  • Tab Button Prefab
    Select: Tab Button
  • Bool Input Prefab
    Select: Toggle
  • String Input Prefab
    Select: Text Input
  • Int Input Prefab
    Select: Int Slider
  • Float Input Prefab
    Select: Float Slider
  • Dropdown Input Prefab
    Select: Dropdown Input

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

Table of Contents
  • Change the UI System
    • UI System Settings
  • TextMesh Pro Setup
    • TMP Settings
    • Creating Own Fonts and Icons
      • TMP Font Asset
      • TMP Sprite Asset
      • Location
  • UI Enviroment Scene
    • Creating the scene
    • Setting up the UI Environment scene
  • Default Input Prefabs
    • Creating the Prefabs
    • Using the Prefabs
      • UI System Settings > Default UI Prefabs
Sitemap
  • ORK 4 BETA
  • Features
  • Showcase
  • Guide
    • Documentation
    • Tutorials
    • API
  • ORK 2 Hub
    • Tutorials
    • Plugins
    • API
  • Support
  • Forum
  • Get ORK
  • Contact
  • Blog
  • Makinom
  • gamingislove.com
Categories
  • News (73)
  • ORK 2 (137)
    • Tutorial (137)
      • Game tutorial (50)
      • Gameplay (32)
      • How-to (55)
  • Release (156)
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!