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
    • Adding Active Time Battles
    • Adding 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: Status Value UI Setup

In this tutorial we’ll set up status value UI using the Unity UI system.

Status value UI is used to display a status value in a HUD or UI box (e.g. in menus). You can set up different variations by using UI Keys, e.g. a HUD displaying health and manage can use a version with a value bar while a status overview display can use a version with only name and values.

We’ll set up 4 variants in this tutorial:

  • name and value
  • name, value and value bar
  • name, value and preview changes (i.e. displaying positive and negative changes from status previews)
  • name, value, value bar and preview changes

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.

Name and Value Prefab #

We’ll start with the simple variant that only displays name and value of a status value. This’ll be the default status value UI and is used as fallback if no UI is found for a provided key.

We can create a ready-to-use setup using the scene hierarchy’s context menu (ORK Framework > HUD > Status Value > Prefab: Status Value – Name+Value) or the ORK toolbar (search for: Status Value Prefab and select the variant with Name+Value).

Rect Transform #

We’ll change the size of the Status Value object.

  • Width
    Set to: 300
  • Height
    Set to: 40

Layout Element #

We’ll usually display status values in a horizontal or vertical list and want them to stick to the size we defined, so we need to make sure by using a Layout Element component.

Add a Layout Element component using the component menu.

  • Preferred Width
    Enable
    Set the value to: 300
  • Preferred Height
    Enable
    Set the value to: 40

Name #

The Status Value > Name child object contains the setup to display the name on the left side. This is handled by the HUD Text Content component, which is the component for all HUD text displays.

The actual display of the content is handled by Image and TextMeshPro – Text (UI) components, i.e. similar to the UI boxes and input prefabs.

Value #

The Status Value > Value child object contains the setup to display the value on the right side. It works the same way as the Name.

Create Prefab #

The finished status value UI should look like this:

Create a prefab out of the Status Value object by dragging it on the project view. Rename the prefab to Status Value UI Default.

Name, Value and Preview Prefab #

We continue working on the setup we just created and add status preview changes. Positive changes will show in green text, negative changes in red text.

We’ll create a new prefab out of the object at the end.

Name: HUD Text Content #

Select the Status Value > Name child object, we’ll change the setup of the HUD Text Content component.

We’ll change the origin of the displayed values to use preview values. Additionally, we’ll use preview blinking, i.e. the value will change between the current and the preview value.

  • Value Origin
    Select: Preview
  • Use Preview Blink
    Enable

Positive Preview Text #

We’ll show the name in a green color.

  • Default Content
    Set to: <color=#00FF00FF><name></color>

Negative Preview Text #

We’ll show the name in a red color.

  • Default Content
    Set to: <color=#FF0000FF><name></color>

Value: HUD Text Content #

Select the Status Value > Value child object, we’ll change the setup of the HUD Text Content component.

We’ll keep it simple and just show the value in green or red color based on the change. If you want, you can also add the change value (<change>) to the texts.

  • Value Origin
    Select: Preview
  • Use Preview Blink
    Enable

Positive Preview Text #

  • Default Content
    Set to: <color=#00FF00FF><value></color>

Negative Preview Text #

  • Default Content
    Set to: <color=#FF0000FF><value></color>

Create Prefab #

Create a prefab out of the Status Value object by dragging it on the project view (create an original prefab). Rename the prefab to Status Value UI Preview.

Remove the object from the canvas.

Name, Value and Value Bar Prefab #

We’ll continue with setting up a variant including a value bar. This is mostly used to display Consumable type status values like health and mana, or to show Experience type status values.

Create a new setup using the scene hierarchy’s context menu (ORK Framework > HUD > Status Value > Prefab: Status Value – Name+Value+Bar) or the ORK toolbar (search for: Status Value Prefab and select the variant with Name+Value+Bar).

Rect Transform #

  • Width
    Set to: 300
  • Height
    Set to: 40

Layout Element #

Add a Layout Element component using the component menu.

  • Preferred Width
    Enable
    Set the value to: 300
  • Preferred Height
    Enable
    Set the value to: 40

Value Bar #

We’ll adjust the value bar to only be displayed at the bottom of the status value UI.

Select the Status Value > Value Bar child object.

Rect Transform #

The value bar uses a stretch stretch anchor preset, i.e. it’ll stretch to the width/height of the parent object.

We’ll add a padding to the top, to have the bar only at the bottom.

  • Top
    Set to: 35

HUD Value Bar Content #

This component handles what’s displayed by the value bar.

HUD Value Bar (Sprite) #

This component handles actually displaying the value bar via multiple Image components (on child objects).

We need to set the sprite used by those components.

Empty Sprite #

Select the Status Value > Value Bar > Empty Sprite child object.

This is used to display the empty part of the value bar.

  • Source Image
    Select: White_16x16
  • Color
    Set to a black color with full alpha (A=1 or A=255, depending on the color picker).

Value Sprite #

Select the Status Value > Value Bar > Value Sprite child object.

This is used to display the filled part of the value bar.

  • Source Image
    Select: White_16x16
  • Color
    Set to a white color with full alpha (A=1 or A=255, depending on the color picker).

The Value Sprite‘s image type should be set to Filled, this enables the value display to fill the sprite according to the value that’s displayed.

Create Prefab #

The finished status value UI should look like this:

Create a prefab out of the Status Value object by dragging it on the project view. Rename the prefab to Status Value UI Bar.

Remove the object from the canvas.

Name, Value, Value Bar and Preview Prefab #

Instead of setting up a new variant from scratch, we’ll duplicate the Status Value UI Preview prefab we created and add a value bar with preview changes to it.

So, duplicate the prefab and rename the new copy to: Status Value UI Bar Preview

Open the prefab for editing.

Value Bar #

Select the root object (Status Value UI Bar Preview) and add a value bar using either the scene hierarchy’s context menu (ORK Framework > HUD > Content > HUD: Value Bar – Changes (Sprite)) or the ORK toolbar (search for: Value Bar Changes Sprite).

Rect Transform #

The value bar uses a stretch stretch anchor preset, we’ll adjust the padding.

  • Left
    Set to: 0
  • Top
    Set to: 35
  • Right
    Set to: 0
  • Bottom
    Set to: 0

HUD Value Bar Content #

We need to set the content to display the value of a status value.

  • Value Type
    Select: Status Value
  • Value Origin
    Select: Preview
  • Use Preview Blinking
    Enable

HUD Value Bar (Sprite) #

This component now uses 4 sprites – empty, value and positive and negative change sprites.

Empty Sprite #

Select the Status Value > Value Bar > Empty Sprite child object.

  • Source Image
    Select: White_16x16
  • Color
    Set to a black color with full alpha (A=1 or A=255, depending on the color picker).

Positive Change Sprite #

Select the Status Value > Value Bar > Positive Change Sprite child object.

  • Source Image
    Select: White_16x16
  • Color
    Set to a green color with full alpha (A=1 or A=255, depending on the color picker).

Negative Change Sprite #

Select the Status Value > Value Bar > Negative Change Sprite child object.

  • Source Image
    Select: White_16x16
  • Color
    Set to a red color with full alpha (A=1 or A=255, depending on the color picker).

Value Sprite #

Select the Status Value > Value Bar > Value Sprite child object.

  • Source Image
    Select: White_16x16
  • Color
    Set to a white color with full alpha (A=1 or A=255, depending on the color picker).

Save Changes #

And that’s it – save the changes you’ve made to the prefab.

HUD Setup #

With our prefabs ready for use, we can set up the status value UI to be used in HUDs and other UI.

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

Default Status Value UI #

  • UI Prefab
    Select: Status Value UI Default
    This is the prefab used as fallback if no UI is found for a key or no key is defined for use.

Click on Add Key Setup.

  • Key
    Set to: bar
  • UI Prefab
    Select: Status Value UI Bar

Click on Add Key Setup again.

  • Key
    Set to: preview
  • UI Prefab
    Select: Status Value UI Preview

Click on Add Key Setup again.

  • Key
    Set to: bar_preview
  • UI Prefab
    Select: Status Value UI Bar Preview

Save Changes #

And that’s it.

Click on Save Settings at the bottom of the editor to save the changes.

Using Status Value UI #

Status value UI is mainly used by HUDs, but can also be displayed in content layout settings (e.g. in menu screens) that offer HUD Type settings to add HUD content.

HUD List Content #

A HUD uses status value UI to list status values in a HUD List Content component.

You can create ready-to-use setups in your HUDs using the scene hierarchy’s context menu (ORK Framework > HUD > Status Value > Status Value List) or the ORK toolbar (search for: Status Value List). There are 3 variants available: without layout, with vertical and with horizontal layout.

You can also manually add a HUD List Content component using the component menu and changing the settings:

  • List Type
    Select: Status Value

Setup #

The most important settings are the List Status Values and the UI Key settings.

List Status Values defines which status values to use – e.g. displaying based on status value type (Consumable, Normal or Experience), content type or by defining individual status values. Based on this setting you’ll have different settings available to further define which status values to display.

The UI Key defines which status value UI variant to use. We’ve set up different variants using different keys, e.g. using the bar UI key will show the name, value and value bar variant we created.

Enabling Show Status Bonus will only show status value bonuses coming from e.g. an equipment or passive ability that’s displayed by the HUD. If disabled, only the actual status values of a combatant are displayed.

Content Layout #

Content layout settings in menus and other UI setup often have a HUD Type setting available to add HUD elements to the UI (e.g. to a button).

If the displayed content is a status value (e.g. in a Status Value Upgrade menu part), you can use the UI Key type to define the UI key of the status value UI you want to use.

Table of Contents
  • Name and Value Prefab
    • Rect Transform
    • Layout Element
    • Name
    • Value
    • Create Prefab
  • Name, Value and Preview Prefab
    • Name: HUD Text Content
      • Positive Preview Text
      • Negative Preview Text
    • Value: HUD Text Content
      • Positive Preview Text
      • Negative Preview Text
    • Create Prefab
  • Name, Value and Value Bar Prefab
    • Rect Transform
    • Layout Element
    • Value Bar
      • Rect Transform
      • HUD Value Bar Content
      • HUD Value Bar (Sprite)
      • Empty Sprite
      • Value Sprite
    • Create Prefab
  • Name, Value, Value Bar and Preview Prefab
    • Value Bar
      • Rect Transform
      • HUD Value Bar Content
      • HUD Value Bar (Sprite)
      • Empty Sprite
      • Positive Change Sprite
      • Negative Change Sprite
      • Value Sprite
    • Save Changes
  • HUD Setup
    • Default Status Value UI
    • Save Changes
  • Using Status Value UI
    • HUD List Content
      • Setup
    • Content Layout
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!