SlideShare a Scribd company logo
Unreal Engine Basics
Chapter 5: User Interface
Nick Prühs
Objectives
• Understanding the difference between Unreal’s UI frameworks Slate
and UMG
• Learning how to create basic and complex user interfaces in UMG
• Learning how to build a simple main menu
Slate & UMG
• Cross-platform user interface framework for creating tool and in-game
UIs
 SWidget base class for all Slate widgets, prefixed with S
 Declarative Syntax
• Wrapped by Unreal Motion Graphics UI Designer (UMG)
 UWidget base class for all UMG widgets
 Higher level, and as UObjects, accounted for by the garbage collector
Slate Example
Example taken from SLoadingScreenTestWidget::Construct
SNew(SVerticalBox)
+SVerticalBox::Slot()
.VAlign(VAlign_Center)
.HAlign(HAlign_Center)
[
SNew(SThrobber)
.Visibility(this, &SLoadingScreenTestWidget::GetLoadIndicatorVisibility)
]
+SVerticalBox::Slot()
.VAlign(VAlign_Center)
.HAlign(HAlign_Center)
[
SNew(STextBlock)
.Text(NSLOCTEXT("MoviePlayerTestLoadingScreen", "LoadingComplete", "Loading complete!"))
.Visibility(this, &SLoadingScreenTestWidget::GetMessageIndicatorVisibility)
]
Widget Blueprints
• Derived from UUserWidget
• Familiar editor
 Designer
 Blueprint Graph
o Events, functions and variables just as with any other blueprint
o Widgets can be explicitly exposed as variable from the designer window
• Built-in support for UI animations
• Widget blueprints can reference other widget blueprints, allowing for
a very modular UI
Widget Blueprints
Can be created and added to the viewport in your PlayerController:
Built-In Widgets
Panels
• Canvas Panel: Allows widgets to be laid out at arbitrary locations, anchored
and z-ordered with other children of the canvas.
• Grid Panel: Evenly divides up available space between all of its children.
• Horizontal Box: Allows widgets to be laid out in a flow horizontally.
• Scroll Box: Scrollable collection of widgets.
• Vertical Box: Allows child widgets to be automatically laid out vertically.
• Widget Switcher: Like a tab control, but without tabs. At most one widget is
visible at time.
• Wrap Box: Arranges widgets left-to-right. When the widgets exceed the
width, it will place widgets on the next line.
Built-In Widgets
Common
• Border: Container widget that can contain one child widget, providing an opportunity to
surround it with a background image and adjustable padding.
• Button: Click-able primitive widget to enable basic interaction.
• CheckBox: Allows you to display a toggled state of 'unchecked', 'checked' and
'indeterminable. You can use the checkbox for a classic checkbox, or as a toggle button, or
as radio buttons.
• Image: Allows you to display a Slate Brush, or texture or material in the UI.
• ProgressBar: Simple bar that fills up.
• RichTextBlock: Text widget supporting inline styles.
• Slider: Shows a sliding bar with a handle that allows you to control the value between 0..1.
• Text: Simple static text widget.
Built-In Widgets
Input
• ComboBox: Displays a list of options to the user in a dropdown menu.
• SpinBox: Numerical entry box that allows for direct entry of the number.
• TextBox: Allows the user to type in custom text.
Other
• (Circular) Throbber: Shows several zooming circles in a row.
• Spacer: Provides padding between other widgets.
• Background Blur: Can contain one child widget, applying a post-process Gaussian
blur to all content beneath it.
Widget Properties
• Appearance
 Color & Opacity: Tints all child widgets.
 Padding: Padding area around the content.
• Interaction
 IsFocusable: Allows this widget to accept focus when clicked, or when
navigated to.
• Behavior
 TooltipWidget: Tooltip widget to show when the user hovers over the
widget with the mouse.
 Is Enabled: Whether this widget can be modified interactively by the
user.
 Visiblity: Visibility of the widget.
Visibility
• Visible: Visible and hit-testable (can interact with cursor). (Default)
• Collapsed: Not visible and takes up no space in the layout (obviously
not hit-testable).
• Hidden: Not visible but occupies layout space (obviously not hit-
testable).
• HitTestInvisible: Visible but not hit-testable (cannot interact with
cursor) and children in the hierarchy (if any) are also not hit-testable.
• SelfHitTestInvisible: Visible but not hit-testable (cannot interact with
cursor), but doesn't affect hit-testing on children (if any).
Canvas Panel Slots
• Anchors
• Position
• Size
• Alignment: Pivot point of the widget.
• Size To Content
• Z Order: Higher values appear on top.
UMG Anchors
Horizontal/Vertical Box Slots
• Padding
• Size
 Auto: Only requests as much
room as it needs based on
the widgets desired size.
 Fill: Greedily attempts to fill
all available room based on
the percentage value 0..1
• Horizontal Alignment
• Vertical Alignment
UMG Box Slot
Text
• Color & Opacity
• Font
• Min Desired Width
• Justification
• Wrapping
UMG Text Block
Fonts
• Font Family
• Typeface
• Size
• Outline Size & Color
UMG Text Block
Localization
• Texts are referenced by namespace & key
• String Tables with texts can be imported from/exported to CSV
Brushes
• Image
• Image Size
• Tint
• Draw As
 None: Don't do anything.
 Box: Draw a 3x3 box where the sides
and the middle stretch based on the
margin.
 Border: Draw a 3x3 border where the
sides tile and the middle is empty.
 Image: Draw an image, ignoring
margin.
• Tiling
• Color & Opacity
Slate Brush
Blueprint Event Binding
• In blueprints, you can bind events in two ways:
 By linking them directly to a (custom) event in your event graph
 By using a Create Event node referencing another event or function
o In functions, only the second option is available.
Button
• Brushes for every state
 Normal
 Hovered
 Pressed
 Disabled
• Hovered and Clicked events
• Single child
 e.g. text, image
UMG Button
Creating Re-Usable Widgets
• Expose public variables for specifying your parameters (e.g. button
text, style)
• Implement PreConstruct event in your widget to apply settings
• Allows for live updates in widget designer
Traveling
Traveling to another level can be achieved by calling Open Level:
• Can specify either a level name or an IP address to travel to
• May provide arbitrary options in form of a “travel URL”:
DM-AwesomeMap?name=FastFragg0r
• Options are automatically passed to be parsed by
AGameMode::InitGame, for instance
Traveling
Reserved built-in travel options include:
• listen: Loads the map as listen server.
• restart: Causes Unreal to just reload the current level.
• closed: Automatically appended by the engine to signal a failed
connection attempt.
• failed: Automatically appended by the engine to signal a failed
connection attempt.
• name: Player name to be set on the PlayerState.
• spectatorOnly: Join as spectator player.
Level Blueprints
• Each level has its own dedicated level blueprint that behaves just like
any other actor blueprint
• Allows to directly reference actors placed in that level
• There are various paradigms on how to deal with level blueprints…
 Don’t use them at all
 Use for inter-blueprint communication, only
 Use them for everything
Hint!
You can specify whether or not to show a mouse cursor with the
Show Mouse Cursor flag of your PlayerController.
Assignment #5 – User Interface
1. Create an ingame HUD with a crosshair.
2. Add a health display to your HUD.
3. Bind input for showing an ingame scoreboard.
4. Create a very basic main menu level and UI.
References
• Epic Games. Slate Overview. https://docs.unrealengine.com/en-
US/Programming/Slate/Overview/index.html, February 2020.
• Epic Games. UMG UI Designer User Guide.
https://docs.unrealengine.com/en-
US/Engine/UMG/UserGuide/index.html, February 2020.
See you next time!
https://www.slideshare.net/npruehs
https://github.com/npruehs/teaching-
unreal-engine/releases/tag/assignment05
npruehs@outlook.com
5 Minute Review Session
• What is the difference between Slate and UMG?
• How can you create a very modular UI in UMG?
• What do you need to do to show your widgets ingame?
• Which kinds of panels do you know?
• What’s the difference between collapsed and hidden visibility?
• Which UI concept facilitates creating resolution-independent UIs?
• How do your globalize your game?
• How can you load another map while ingame?
Ad

Recommended

Unreal Engine Basics 01 - Game Framework
Unreal Engine Basics 01 - Game Framework
Nick Pruehs
 
Unreal Engine Basics 03 - Gameplay
Unreal Engine Basics 03 - Gameplay
Nick Pruehs
 
Unreal Engine Basics 02 - Unreal Editor
Unreal Engine Basics 02 - Unreal Editor
Nick Pruehs
 
Unreal Engine 4 Introduction
Unreal Engine 4 Introduction
Sperasoft
 
Introduction to Game Development
Introduction to Game Development
iTawy Community
 
GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...
GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...
Gerke Max Preussner
 
Game Development with Unity
Game Development with Unity
davidluzgouveia
 
UE4 Garbage Collection
UE4 Garbage Collection
QooJuice
 
Component-Based Entity Systems (Demo)
Component-Based Entity Systems (Demo)
Nick Pruehs
 
Phases of game development
Phases of game development
Victor Terekhovskyi
 
Unreal_GameAbilitySystem.pptx
Unreal_GameAbilitySystem.pptx
TonyCms
 
Unity 3D, A game engine
Unity 3D, A game engine
Md. Irteza rahman Masud
 
West Coast DevCon 2014: Game Programming in UE4 - Game Framework & Sample Pro...
West Coast DevCon 2014: Game Programming in UE4 - Game Framework & Sample Pro...
Gerke Max Preussner
 
East Coast DevCon 2014: The Slate UI Framework - Architecture & Tools
East Coast DevCon 2014: The Slate UI Framework - Architecture & Tools
Gerke Max Preussner
 
[NDC 2009] 행동 트리로 구현하는 인공지능
[NDC 2009] 행동 트리로 구현하는 인공지능
Yongha Kim
 
Introduction to game development
Introduction to game development
Abdelrahman Ahmed
 
2-Game Design (Game Design and Development)
2-Game Design (Game Design and Development)
Hafiz Ammar Siddiqui
 
Game dev process
Game dev process
Yassine Arif
 
Making a Game Design Document
Making a Game Design Document
Equal Experts
 
Introduction to Game Development
Introduction to Game Development
Reggie Niccolo Santos
 
Tips and experience of DX12 Engine development .
Tips and experience of DX12 Engine development .
YEONG-CHEON YOU
 
Unreal Open Day 2017 UE4 for Mobile: The Future of High Quality Mobile Games
Unreal Open Day 2017 UE4 for Mobile: The Future of High Quality Mobile Games
Epic Games China
 
Introduction to Game Design
Introduction to Game Design
Christian Chomiak
 
A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)
A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)
David Salz
 
Unreal Engine Basics 04 - Behavior Trees
Unreal Engine Basics 04 - Behavior Trees
Nick Pruehs
 
Introduction to Unity3D Game Engine
Introduction to Unity3D Game Engine
Mohsen Mirhoseini
 
게임제작개론: #1 게임 구성 요소의 이해
게임제작개론: #1 게임 구성 요소의 이해
Seungmo Koo
 
Introduction to Game Development
Introduction to Game Development
Shaan Alam
 
West Coast DevCon 2014: The Slate UI Framework (Part 1) - Introduction
West Coast DevCon 2014: The Slate UI Framework (Part 1) - Introduction
Gerke Max Preussner
 
Qt Developer Days 2009 Keynote - Portable UIs
Qt Developer Days 2009 Keynote - Portable UIs
account inactive
 

More Related Content

What's hot (20)

Component-Based Entity Systems (Demo)
Component-Based Entity Systems (Demo)
Nick Pruehs
 
Phases of game development
Phases of game development
Victor Terekhovskyi
 
Unreal_GameAbilitySystem.pptx
Unreal_GameAbilitySystem.pptx
TonyCms
 
Unity 3D, A game engine
Unity 3D, A game engine
Md. Irteza rahman Masud
 
West Coast DevCon 2014: Game Programming in UE4 - Game Framework & Sample Pro...
West Coast DevCon 2014: Game Programming in UE4 - Game Framework & Sample Pro...
Gerke Max Preussner
 
East Coast DevCon 2014: The Slate UI Framework - Architecture & Tools
East Coast DevCon 2014: The Slate UI Framework - Architecture & Tools
Gerke Max Preussner
 
[NDC 2009] 행동 트리로 구현하는 인공지능
[NDC 2009] 행동 트리로 구현하는 인공지능
Yongha Kim
 
Introduction to game development
Introduction to game development
Abdelrahman Ahmed
 
2-Game Design (Game Design and Development)
2-Game Design (Game Design and Development)
Hafiz Ammar Siddiqui
 
Game dev process
Game dev process
Yassine Arif
 
Making a Game Design Document
Making a Game Design Document
Equal Experts
 
Introduction to Game Development
Introduction to Game Development
Reggie Niccolo Santos
 
Tips and experience of DX12 Engine development .
Tips and experience of DX12 Engine development .
YEONG-CHEON YOU
 
Unreal Open Day 2017 UE4 for Mobile: The Future of High Quality Mobile Games
Unreal Open Day 2017 UE4 for Mobile: The Future of High Quality Mobile Games
Epic Games China
 
Introduction to Game Design
Introduction to Game Design
Christian Chomiak
 
A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)
A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)
David Salz
 
Unreal Engine Basics 04 - Behavior Trees
Unreal Engine Basics 04 - Behavior Trees
Nick Pruehs
 
Introduction to Unity3D Game Engine
Introduction to Unity3D Game Engine
Mohsen Mirhoseini
 
게임제작개론: #1 게임 구성 요소의 이해
게임제작개론: #1 게임 구성 요소의 이해
Seungmo Koo
 
Introduction to Game Development
Introduction to Game Development
Shaan Alam
 
Component-Based Entity Systems (Demo)
Component-Based Entity Systems (Demo)
Nick Pruehs
 
Unreal_GameAbilitySystem.pptx
Unreal_GameAbilitySystem.pptx
TonyCms
 
West Coast DevCon 2014: Game Programming in UE4 - Game Framework & Sample Pro...
West Coast DevCon 2014: Game Programming in UE4 - Game Framework & Sample Pro...
Gerke Max Preussner
 
East Coast DevCon 2014: The Slate UI Framework - Architecture & Tools
East Coast DevCon 2014: The Slate UI Framework - Architecture & Tools
Gerke Max Preussner
 
[NDC 2009] 행동 트리로 구현하는 인공지능
[NDC 2009] 행동 트리로 구현하는 인공지능
Yongha Kim
 
Introduction to game development
Introduction to game development
Abdelrahman Ahmed
 
2-Game Design (Game Design and Development)
2-Game Design (Game Design and Development)
Hafiz Ammar Siddiqui
 
Making a Game Design Document
Making a Game Design Document
Equal Experts
 
Tips and experience of DX12 Engine development .
Tips and experience of DX12 Engine development .
YEONG-CHEON YOU
 
Unreal Open Day 2017 UE4 for Mobile: The Future of High Quality Mobile Games
Unreal Open Day 2017 UE4 for Mobile: The Future of High Quality Mobile Games
Epic Games China
 
A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)
A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)
David Salz
 
Unreal Engine Basics 04 - Behavior Trees
Unreal Engine Basics 04 - Behavior Trees
Nick Pruehs
 
Introduction to Unity3D Game Engine
Introduction to Unity3D Game Engine
Mohsen Mirhoseini
 
게임제작개론: #1 게임 구성 요소의 이해
게임제작개론: #1 게임 구성 요소의 이해
Seungmo Koo
 
Introduction to Game Development
Introduction to Game Development
Shaan Alam
 

Similar to Unreal Engine Basics 05 - User Interface (20)

West Coast DevCon 2014: The Slate UI Framework (Part 1) - Introduction
West Coast DevCon 2014: The Slate UI Framework (Part 1) - Introduction
Gerke Max Preussner
 
Qt Developer Days 2009 Keynote - Portable UIs
Qt Developer Days 2009 Keynote - Portable UIs
account inactive
 
Wavemaker AJAX
Wavemaker AJAX
basmaat
 
West Coast DevCon 2014: The Slate UI Framework (Part 2) - Game UI & Unreal Mo...
West Coast DevCon 2014: The Slate UI Framework (Part 2) - Game UI & Unreal Mo...
Gerke Max Preussner
 
COMP 4026 Lecture4: Processing and Advanced Interface Technology
COMP 4026 Lecture4: Processing and Advanced Interface Technology
Mark Billinghurst
 
Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals
Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals
ukdpe
 
ICS3211 Lecture 08 2020
ICS3211 Lecture 08 2020
Vanessa Camilleri
 
Python - gui programming (tkinter)
Python - gui programming (tkinter)
Learnbay Datascience
 
Windows phone and azure
Windows phone and azure
★ Dovydas Navickas
 
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKit
Ariya Hidayat
 
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKit
Ariya Hidayat
 
Developing Mobile Apps, Lecture 5
Developing Mobile Apps, Lecture 5
fpatton
 
Conquering the code in softimage
Conquering the code in softimage
Jared Glass
 
A Complete seminar on GUI Development in python
A Complete seminar on GUI Development in python
18547Mymoon
 
Sense and sense ability - TU100 13J
Sense and sense ability - TU100 13J
Nigel Gibson
 
Hybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKit
Ariya Hidayat
 
Mobile Gaming: Corona SDK & Adobe AIR RIA Unleashed 2011
Mobile Gaming: Corona SDK & Adobe AIR RIA Unleashed 2011
Jesse Warden
 
Lwuit developer guide
Lwuit developer guide
mahassine_med_amine
 
Google web toolkit web conference presenation
Google web toolkit web conference presenation
Stephen Erdman
 
JavaFX 1.0 SDK Aquarium Paris
JavaFX 1.0 SDK Aquarium Paris
Alexis Moussine-Pouchkine
 
West Coast DevCon 2014: The Slate UI Framework (Part 1) - Introduction
West Coast DevCon 2014: The Slate UI Framework (Part 1) - Introduction
Gerke Max Preussner
 
Qt Developer Days 2009 Keynote - Portable UIs
Qt Developer Days 2009 Keynote - Portable UIs
account inactive
 
Wavemaker AJAX
Wavemaker AJAX
basmaat
 
West Coast DevCon 2014: The Slate UI Framework (Part 2) - Game UI & Unreal Mo...
West Coast DevCon 2014: The Slate UI Framework (Part 2) - Game UI & Unreal Mo...
Gerke Max Preussner
 
COMP 4026 Lecture4: Processing and Advanced Interface Technology
COMP 4026 Lecture4: Processing and Advanced Interface Technology
Mark Billinghurst
 
Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals
Mike Taulty MIX10 Silverlight 4 Accelerated Fundamentals
ukdpe
 
Python - gui programming (tkinter)
Python - gui programming (tkinter)
Learnbay Datascience
 
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKit
Ariya Hidayat
 
Hybrid Apps (Native + Web) using WebKit
Hybrid Apps (Native + Web) using WebKit
Ariya Hidayat
 
Developing Mobile Apps, Lecture 5
Developing Mobile Apps, Lecture 5
fpatton
 
Conquering the code in softimage
Conquering the code in softimage
Jared Glass
 
A Complete seminar on GUI Development in python
A Complete seminar on GUI Development in python
18547Mymoon
 
Sense and sense ability - TU100 13J
Sense and sense ability - TU100 13J
Nigel Gibson
 
Hybrid Apps (Native + Web) via QtWebKit
Hybrid Apps (Native + Web) via QtWebKit
Ariya Hidayat
 
Mobile Gaming: Corona SDK & Adobe AIR RIA Unleashed 2011
Mobile Gaming: Corona SDK & Adobe AIR RIA Unleashed 2011
Jesse Warden
 
Google web toolkit web conference presenation
Google web toolkit web conference presenation
Stephen Erdman
 
Ad

More from Nick Pruehs (20)

Unreal Engine Basics 06 - Animation, Audio, Visual Effects
Unreal Engine Basics 06 - Animation, Audio, Visual Effects
Nick Pruehs
 
Game Programming - Cloud Development
Game Programming - Cloud Development
Nick Pruehs
 
Game Programming - Git
Game Programming - Git
Nick Pruehs
 
Eight Rules for Making Your First Great Game
Eight Rules for Making Your First Great Game
Nick Pruehs
 
Designing an actor model game architecture with Pony
Designing an actor model game architecture with Pony
Nick Pruehs
 
Game Programming 13 - Debugging & Performance Optimization
Game Programming 13 - Debugging & Performance Optimization
Nick Pruehs
 
Scrum - but... Agile Game Development in Small Teams
Scrum - but... Agile Game Development in Small Teams
Nick Pruehs
 
What Would Blizzard Do
What Would Blizzard Do
Nick Pruehs
 
School For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine Basics
Nick Pruehs
 
Tool Development A - Git
Tool Development A - Git
Nick Pruehs
 
Game Programming 12 - Shaders
Game Programming 12 - Shaders
Nick Pruehs
 
Game Programming 11 - Game Physics
Game Programming 11 - Game Physics
Nick Pruehs
 
Game Programming 10 - Localization
Game Programming 10 - Localization
Nick Pruehs
 
Game Programming 09 - AI
Game Programming 09 - AI
Nick Pruehs
 
Game Development Challenges
Game Development Challenges
Nick Pruehs
 
Game Programming 08 - Tool Development
Game Programming 08 - Tool Development
Nick Pruehs
 
Game Programming 07 - Procedural Content Generation
Game Programming 07 - Procedural Content Generation
Nick Pruehs
 
Game Programming 06 - Automated Testing
Game Programming 06 - Automated Testing
Nick Pruehs
 
Game Programming 05 - Development Tools
Game Programming 05 - Development Tools
Nick Pruehs
 
Game Programming 04 - Style & Design Principles
Game Programming 04 - Style & Design Principles
Nick Pruehs
 
Unreal Engine Basics 06 - Animation, Audio, Visual Effects
Unreal Engine Basics 06 - Animation, Audio, Visual Effects
Nick Pruehs
 
Game Programming - Cloud Development
Game Programming - Cloud Development
Nick Pruehs
 
Game Programming - Git
Game Programming - Git
Nick Pruehs
 
Eight Rules for Making Your First Great Game
Eight Rules for Making Your First Great Game
Nick Pruehs
 
Designing an actor model game architecture with Pony
Designing an actor model game architecture with Pony
Nick Pruehs
 
Game Programming 13 - Debugging & Performance Optimization
Game Programming 13 - Debugging & Performance Optimization
Nick Pruehs
 
Scrum - but... Agile Game Development in Small Teams
Scrum - but... Agile Game Development in Small Teams
Nick Pruehs
 
What Would Blizzard Do
What Would Blizzard Do
Nick Pruehs
 
School For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine Basics
Nick Pruehs
 
Tool Development A - Git
Tool Development A - Git
Nick Pruehs
 
Game Programming 12 - Shaders
Game Programming 12 - Shaders
Nick Pruehs
 
Game Programming 11 - Game Physics
Game Programming 11 - Game Physics
Nick Pruehs
 
Game Programming 10 - Localization
Game Programming 10 - Localization
Nick Pruehs
 
Game Programming 09 - AI
Game Programming 09 - AI
Nick Pruehs
 
Game Development Challenges
Game Development Challenges
Nick Pruehs
 
Game Programming 08 - Tool Development
Game Programming 08 - Tool Development
Nick Pruehs
 
Game Programming 07 - Procedural Content Generation
Game Programming 07 - Procedural Content Generation
Nick Pruehs
 
Game Programming 06 - Automated Testing
Game Programming 06 - Automated Testing
Nick Pruehs
 
Game Programming 05 - Development Tools
Game Programming 05 - Development Tools
Nick Pruehs
 
Game Programming 04 - Style & Design Principles
Game Programming 04 - Style & Design Principles
Nick Pruehs
 
Ad

Recently uploaded (20)

OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
UserCon Belgium: Honey, VMware increased my bill
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
Lessons Learned from Developing Secure AI Workflows.pdf
Lessons Learned from Developing Secure AI Workflows.pdf
Priyanka Aash
 
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Josef Weingand
 
You are not excused! How to avoid security blind spots on the way to production
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
OpenPOWER Foundation & Open-Source Core Innovations
OpenPOWER Foundation & Open-Source Core Innovations
IBM
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
AI VIDEO MAGAZINE - June 2025 - r/aivideo
AI VIDEO MAGAZINE - June 2025 - r/aivideo
1pcity Studios, Inc
 
"Database isolation: how we deal with hundreds of direct connections to the d...
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
cnc-processing-centers-centateq-p-110-en.pdf
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
The Future of Product Management in AI ERA.pdf
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
Quantum AI: Where Impossible Becomes Probable
Quantum AI: Where Impossible Becomes Probable
Saikat Basu
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
UserCon Belgium: Honey, VMware increased my bill
UserCon Belgium: Honey, VMware increased my bill
stijn40
 
Lessons Learned from Developing Secure AI Workflows.pdf
Lessons Learned from Developing Secure AI Workflows.pdf
Priyanka Aash
 
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Wenn alles versagt - IBM Tape schützt, was zählt! Und besonders mit dem neust...
Josef Weingand
 
You are not excused! How to avoid security blind spots on the way to production
You are not excused! How to avoid security blind spots on the way to production
Michele Leroux Bustamante
 
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
Tech-ASan: Two-stage check for Address Sanitizer - Yixuan Cao.pdf
caoyixuan2019
 
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
" How to survive with 1 billion vectors and not sell a kidney: our low-cost c...
Fwdays
 
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Cracking the Code - Unveiling Synergies Between Open Source Security and AI.pdf
Priyanka Aash
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
OpenPOWER Foundation & Open-Source Core Innovations
OpenPOWER Foundation & Open-Source Core Innovations
IBM
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
AI VIDEO MAGAZINE - June 2025 - r/aivideo
AI VIDEO MAGAZINE - June 2025 - r/aivideo
1pcity Studios, Inc
 
"Database isolation: how we deal with hundreds of direct connections to the d...
"Database isolation: how we deal with hundreds of direct connections to the d...
Fwdays
 
Security Tips for Enterprise Azure Solutions
Security Tips for Enterprise Azure Solutions
Michele Leroux Bustamante
 
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Coordinated Disclosure for ML - What's Different and What's the Same.pdf
Priyanka Aash
 
cnc-processing-centers-centateq-p-110-en.pdf
cnc-processing-centers-centateq-p-110-en.pdf
AmirStern2
 
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
Salesforce Summer '25 Release Frenchgathering.pptx.pdf
yosra Saidani
 
The Future of Product Management in AI ERA.pdf
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
CapCut Pro Crack For PC Latest Version {Fully Unlocked} 2025
pcprocore
 
Quantum AI: Where Impossible Becomes Probable
Quantum AI: Where Impossible Becomes Probable
Saikat Basu
 

Unreal Engine Basics 05 - User Interface

  • 1. Unreal Engine Basics Chapter 5: User Interface Nick Prühs
  • 2. Objectives • Understanding the difference between Unreal’s UI frameworks Slate and UMG • Learning how to create basic and complex user interfaces in UMG • Learning how to build a simple main menu
  • 3. Slate & UMG • Cross-platform user interface framework for creating tool and in-game UIs  SWidget base class for all Slate widgets, prefixed with S  Declarative Syntax • Wrapped by Unreal Motion Graphics UI Designer (UMG)  UWidget base class for all UMG widgets  Higher level, and as UObjects, accounted for by the garbage collector
  • 4. Slate Example Example taken from SLoadingScreenTestWidget::Construct SNew(SVerticalBox) +SVerticalBox::Slot() .VAlign(VAlign_Center) .HAlign(HAlign_Center) [ SNew(SThrobber) .Visibility(this, &SLoadingScreenTestWidget::GetLoadIndicatorVisibility) ] +SVerticalBox::Slot() .VAlign(VAlign_Center) .HAlign(HAlign_Center) [ SNew(STextBlock) .Text(NSLOCTEXT("MoviePlayerTestLoadingScreen", "LoadingComplete", "Loading complete!")) .Visibility(this, &SLoadingScreenTestWidget::GetMessageIndicatorVisibility) ]
  • 5. Widget Blueprints • Derived from UUserWidget • Familiar editor  Designer  Blueprint Graph o Events, functions and variables just as with any other blueprint o Widgets can be explicitly exposed as variable from the designer window • Built-in support for UI animations • Widget blueprints can reference other widget blueprints, allowing for a very modular UI
  • 6. Widget Blueprints Can be created and added to the viewport in your PlayerController:
  • 7. Built-In Widgets Panels • Canvas Panel: Allows widgets to be laid out at arbitrary locations, anchored and z-ordered with other children of the canvas. • Grid Panel: Evenly divides up available space between all of its children. • Horizontal Box: Allows widgets to be laid out in a flow horizontally. • Scroll Box: Scrollable collection of widgets. • Vertical Box: Allows child widgets to be automatically laid out vertically. • Widget Switcher: Like a tab control, but without tabs. At most one widget is visible at time. • Wrap Box: Arranges widgets left-to-right. When the widgets exceed the width, it will place widgets on the next line.
  • 8. Built-In Widgets Common • Border: Container widget that can contain one child widget, providing an opportunity to surround it with a background image and adjustable padding. • Button: Click-able primitive widget to enable basic interaction. • CheckBox: Allows you to display a toggled state of 'unchecked', 'checked' and 'indeterminable. You can use the checkbox for a classic checkbox, or as a toggle button, or as radio buttons. • Image: Allows you to display a Slate Brush, or texture or material in the UI. • ProgressBar: Simple bar that fills up. • RichTextBlock: Text widget supporting inline styles. • Slider: Shows a sliding bar with a handle that allows you to control the value between 0..1. • Text: Simple static text widget.
  • 9. Built-In Widgets Input • ComboBox: Displays a list of options to the user in a dropdown menu. • SpinBox: Numerical entry box that allows for direct entry of the number. • TextBox: Allows the user to type in custom text. Other • (Circular) Throbber: Shows several zooming circles in a row. • Spacer: Provides padding between other widgets. • Background Blur: Can contain one child widget, applying a post-process Gaussian blur to all content beneath it.
  • 10. Widget Properties • Appearance  Color & Opacity: Tints all child widgets.  Padding: Padding area around the content. • Interaction  IsFocusable: Allows this widget to accept focus when clicked, or when navigated to. • Behavior  TooltipWidget: Tooltip widget to show when the user hovers over the widget with the mouse.  Is Enabled: Whether this widget can be modified interactively by the user.  Visiblity: Visibility of the widget.
  • 11. Visibility • Visible: Visible and hit-testable (can interact with cursor). (Default) • Collapsed: Not visible and takes up no space in the layout (obviously not hit-testable). • Hidden: Not visible but occupies layout space (obviously not hit- testable). • HitTestInvisible: Visible but not hit-testable (cannot interact with cursor) and children in the hierarchy (if any) are also not hit-testable. • SelfHitTestInvisible: Visible but not hit-testable (cannot interact with cursor), but doesn't affect hit-testing on children (if any).
  • 12. Canvas Panel Slots • Anchors • Position • Size • Alignment: Pivot point of the widget. • Size To Content • Z Order: Higher values appear on top. UMG Anchors
  • 13. Horizontal/Vertical Box Slots • Padding • Size  Auto: Only requests as much room as it needs based on the widgets desired size.  Fill: Greedily attempts to fill all available room based on the percentage value 0..1 • Horizontal Alignment • Vertical Alignment UMG Box Slot
  • 14. Text • Color & Opacity • Font • Min Desired Width • Justification • Wrapping UMG Text Block
  • 15. Fonts • Font Family • Typeface • Size • Outline Size & Color UMG Text Block
  • 16. Localization • Texts are referenced by namespace & key • String Tables with texts can be imported from/exported to CSV
  • 17. Brushes • Image • Image Size • Tint • Draw As  None: Don't do anything.  Box: Draw a 3x3 box where the sides and the middle stretch based on the margin.  Border: Draw a 3x3 border where the sides tile and the middle is empty.  Image: Draw an image, ignoring margin. • Tiling • Color & Opacity Slate Brush
  • 18. Blueprint Event Binding • In blueprints, you can bind events in two ways:  By linking them directly to a (custom) event in your event graph  By using a Create Event node referencing another event or function o In functions, only the second option is available.
  • 19. Button • Brushes for every state  Normal  Hovered  Pressed  Disabled • Hovered and Clicked events • Single child  e.g. text, image UMG Button
  • 20. Creating Re-Usable Widgets • Expose public variables for specifying your parameters (e.g. button text, style) • Implement PreConstruct event in your widget to apply settings • Allows for live updates in widget designer
  • 21. Traveling Traveling to another level can be achieved by calling Open Level: • Can specify either a level name or an IP address to travel to • May provide arbitrary options in form of a “travel URL”: DM-AwesomeMap?name=FastFragg0r • Options are automatically passed to be parsed by AGameMode::InitGame, for instance
  • 22. Traveling Reserved built-in travel options include: • listen: Loads the map as listen server. • restart: Causes Unreal to just reload the current level. • closed: Automatically appended by the engine to signal a failed connection attempt. • failed: Automatically appended by the engine to signal a failed connection attempt. • name: Player name to be set on the PlayerState. • spectatorOnly: Join as spectator player.
  • 23. Level Blueprints • Each level has its own dedicated level blueprint that behaves just like any other actor blueprint • Allows to directly reference actors placed in that level • There are various paradigms on how to deal with level blueprints…  Don’t use them at all  Use for inter-blueprint communication, only  Use them for everything
  • 24. Hint! You can specify whether or not to show a mouse cursor with the Show Mouse Cursor flag of your PlayerController.
  • 25. Assignment #5 – User Interface 1. Create an ingame HUD with a crosshair. 2. Add a health display to your HUD. 3. Bind input for showing an ingame scoreboard. 4. Create a very basic main menu level and UI.
  • 26. References • Epic Games. Slate Overview. https://docs.unrealengine.com/en- US/Programming/Slate/Overview/index.html, February 2020. • Epic Games. UMG UI Designer User Guide. https://docs.unrealengine.com/en- US/Engine/UMG/UserGuide/index.html, February 2020.
  • 27. See you next time! https://www.slideshare.net/npruehs https://github.com/npruehs/teaching- unreal-engine/releases/tag/assignment05 [email protected]
  • 28. 5 Minute Review Session • What is the difference between Slate and UMG? • How can you create a very modular UI in UMG? • What do you need to do to show your widgets ingame? • Which kinds of panels do you know? • What’s the difference between collapsed and hidden visibility? • Which UI concept facilitates creating resolution-independent UIs? • How do your globalize your game? • How can you load another map while ingame?