SlideShare una empresa de Scribd logo
1 de 28
Descargar para leer sin conexión
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?

Más contenido relacionado

La actualidad más candente

06_게임엔진구성
06_게임엔진구성06_게임엔진구성
06_게임엔진구성
noerror
 
김동건, 할머니가 들려주신 마비노기 개발 전설, NDC2019
김동건, 할머니가 들려주신 마비노기 개발 전설, NDC2019김동건, 할머니가 들려주신 마비노기 개발 전설, NDC2019
김동건, 할머니가 들려주신 마비노기 개발 전설, NDC2019
devCAT Studio, NEXON
 
Game engines and Their Influence in Game Design
Game engines and Their Influence in Game DesignGame engines and Their Influence in Game Design
Game engines and Their Influence in Game Design
Prashant Warrier
 
전형규, SilvervineUE4Lua: UE4에서 Lua 사용하기, NDC2019
전형규, SilvervineUE4Lua: UE4에서 Lua 사용하기, NDC2019전형규, SilvervineUE4Lua: UE4에서 Lua 사용하기, NDC2019
전형규, SilvervineUE4Lua: UE4에서 Lua 사용하기, NDC2019
devCAT Studio, NEXON
 

La actualidad más candente (20)

GameInstance에 대해서 알아보자
GameInstance에 대해서 알아보자GameInstance에 대해서 알아보자
GameInstance에 대해서 알아보자
 
Bethesda's Iterative Level Design Process for Skyrim and Fallout 3
Bethesda's Iterative Level Design Process for Skyrim and Fallout 3Bethesda's Iterative Level Design Process for Skyrim and Fallout 3
Bethesda's Iterative Level Design Process for Skyrim and Fallout 3
 
Unreal Engine Basics 04 - Behavior Trees
Unreal Engine Basics 04 - Behavior TreesUnreal Engine Basics 04 - Behavior Trees
Unreal Engine Basics 04 - Behavior Trees
 
Game Programming 07 - Procedural Content Generation
Game Programming 07 - Procedural Content GenerationGame Programming 07 - Procedural Content Generation
Game Programming 07 - Procedural Content Generation
 
AAA게임_UI_최적화_및_빌드하기.pptx
AAA게임_UI_최적화_및_빌드하기.pptxAAA게임_UI_최적화_및_빌드하기.pptx
AAA게임_UI_최적화_및_빌드하기.pptx
 
NDC2016 프로젝트 A1의 AAA급 캐릭터 렌더링 기술
NDC2016 프로젝트 A1의 AAA급 캐릭터 렌더링 기술NDC2016 프로젝트 A1의 AAA급 캐릭터 렌더링 기술
NDC2016 프로젝트 A1의 AAA급 캐릭터 렌더링 기술
 
도우진&김영수, 게임잼 운영과 게이미피케이션, NDC2012
도우진&김영수, 게임잼 운영과 게이미피케이션, NDC2012도우진&김영수, 게임잼 운영과 게이미피케이션, NDC2012
도우진&김영수, 게임잼 운영과 게이미피케이션, NDC2012
 
언리얼4 플레이어 컨트롤러의 이해.
언리얼4 플레이어 컨트롤러의 이해.언리얼4 플레이어 컨트롤러의 이해.
언리얼4 플레이어 컨트롤러의 이해.
 
06_게임엔진구성
06_게임엔진구성06_게임엔진구성
06_게임엔진구성
 
LOD and Culling Systems That Scale - Unite LA
LOD and Culling Systems That Scale  - Unite LALOD and Culling Systems That Scale  - Unite LA
LOD and Culling Systems That Scale - Unite LA
 
언리얼을 활용한 오브젝트 풀링
언리얼을 활용한 오브젝트 풀링언리얼을 활용한 오브젝트 풀링
언리얼을 활용한 오브젝트 풀링
 
[NDC2017] 뛰는 프로그래머 나는 언리얼 엔진 - 언알못에서 커미터까지
[NDC2017] 뛰는 프로그래머 나는 언리얼 엔진 - 언알못에서 커미터까지[NDC2017] 뛰는 프로그래머 나는 언리얼 엔진 - 언알못에서 커미터까지
[NDC2017] 뛰는 프로그래머 나는 언리얼 엔진 - 언알못에서 커미터까지
 
김동건, 할머니가 들려주신 마비노기 개발 전설, NDC2019
김동건, 할머니가 들려주신 마비노기 개발 전설, NDC2019김동건, 할머니가 들려주신 마비노기 개발 전설, NDC2019
김동건, 할머니가 들려주신 마비노기 개발 전설, NDC2019
 
Unreal perception
Unreal perceptionUnreal perception
Unreal perception
 
Unity 3d Basics
Unity 3d BasicsUnity 3d Basics
Unity 3d Basics
 
Game engines and Their Influence in Game Design
Game engines and Their Influence in Game DesignGame engines and Their Influence in Game Design
Game engines and Their Influence in Game Design
 
전형규, SilvervineUE4Lua: UE4에서 Lua 사용하기, NDC2019
전형규, SilvervineUE4Lua: UE4에서 Lua 사용하기, NDC2019전형규, SilvervineUE4Lua: UE4에서 Lua 사용하기, NDC2019
전형규, SilvervineUE4Lua: UE4에서 Lua 사용하기, NDC2019
 
Component-Based Entity Systems (Demo)
Component-Based Entity Systems (Demo)Component-Based Entity Systems (Demo)
Component-Based Entity Systems (Demo)
 
게임 인공지능 설계
게임 인공지능 설계게임 인공지능 설계
게임 인공지능 설계
 
[IGC2018] 청강대 이득우 - 언리얼에디터확장을위해알아야할것들
[IGC2018] 청강대 이득우 - 언리얼에디터확장을위해알아야할것들[IGC2018] 청강대 이득우 - 언리얼에디터확장을위해알아야할것들
[IGC2018] 청강대 이득우 - 언리얼에디터확장을위해알아야할것들
 

Similar a Unreal Engine Basics 05 - User Interface

East Coast DevCon 2014: The Slate UI Framework - Architecture & Tools
East Coast DevCon 2014: The Slate UI Framework - Architecture & ToolsEast Coast DevCon 2014: The Slate UI Framework - Architecture & Tools
East Coast DevCon 2014: The Slate UI Framework - Architecture & Tools
Gerke Max Preussner
 
Android and IOS UI Development (Android 5.0 and iOS 9.0)
Android and IOS UI Development (Android 5.0 and iOS 9.0)Android and IOS UI Development (Android 5.0 and iOS 9.0)
Android and IOS UI Development (Android 5.0 and iOS 9.0)
Michael Shrove
 
Ch4 creating user interfaces
Ch4 creating user interfacesCh4 creating user interfaces
Ch4 creating user interfaces
Shih-Hsiang Lin
 

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

tL19 awt
tL19 awttL19 awt
tL19 awt
 
East Coast DevCon 2014: The Slate UI Framework - Architecture & Tools
East Coast DevCon 2014: The Slate UI Framework - Architecture & ToolsEast Coast DevCon 2014: The Slate UI Framework - Architecture & Tools
East Coast DevCon 2014: The Slate UI Framework - Architecture & Tools
 
14a-gui.ppt
14a-gui.ppt14a-gui.ppt
14a-gui.ppt
 
Start developing projects with Scratch Programming
Start developing projects with Scratch ProgrammingStart developing projects with Scratch Programming
Start developing projects with Scratch Programming
 
Android and IOS UI Development (Android 5.0 and iOS 9.0)
Android and IOS UI Development (Android 5.0 and iOS 9.0)Android and IOS UI Development (Android 5.0 and iOS 9.0)
Android and IOS UI Development (Android 5.0 and iOS 9.0)
 
Robot flash tutorial
Robot flash tutorialRobot flash tutorial
Robot flash tutorial
 
Swift
SwiftSwift
Swift
 
Cets 2016 felstehausen wallace to use a layer state change or new slide, that...
Cets 2016 felstehausen wallace to use a layer state change or new slide, that...Cets 2016 felstehausen wallace to use a layer state change or new slide, that...
Cets 2016 felstehausen wallace to use a layer state change or new slide, that...
 
Divergent and Convergent Thinking – Brain
Divergent and Convergent Thinking – BrainDivergent and Convergent Thinking – Brain
Divergent and Convergent Thinking – Brain
 
Drawing Tool
Drawing ToolDrawing Tool
Drawing Tool
 
03_GUI.ppt
03_GUI.ppt03_GUI.ppt
03_GUI.ppt
 
JAVA Programming: Topic -AWT(Abstract Window Tool )
JAVA Programming: Topic -AWT(Abstract Window Tool )JAVA Programming: Topic -AWT(Abstract Window Tool )
JAVA Programming: Topic -AWT(Abstract Window Tool )
 
Visual Basic IDE Introduction
Visual Basic IDE IntroductionVisual Basic IDE Introduction
Visual Basic IDE Introduction
 
Visual Basic IDE Intro.pdf
Visual Basic IDE Intro.pdfVisual Basic IDE Intro.pdf
Visual Basic IDE Intro.pdf
 
Lecture 5 _ Building Layouts (1).pptx
Lecture 5 _ Building Layouts (1).pptxLecture 5 _ Building Layouts (1).pptx
Lecture 5 _ Building Layouts (1).pptx
 
Ajp notes-chapter-01
Ajp notes-chapter-01Ajp notes-chapter-01
Ajp notes-chapter-01
 
Mobile Application Development class 005
Mobile Application Development class 005Mobile Application Development class 005
Mobile Application Development class 005
 
Microsoft Windows 7 Fundamentals (8th Ed.)
Microsoft Windows 7 Fundamentals (8th Ed.)Microsoft Windows 7 Fundamentals (8th Ed.)
Microsoft Windows 7 Fundamentals (8th Ed.)
 
Ch4 creating user interfaces
Ch4 creating user interfacesCh4 creating user interfaces
Ch4 creating user interfaces
 
Introduction to UiAutomation EMEA APAC.pdf
Introduction to UiAutomation EMEA APAC.pdfIntroduction to UiAutomation EMEA APAC.pdf
Introduction to UiAutomation EMEA APAC.pdf
 

Más de Nick Pruehs

Más de Nick Pruehs (20)

Unreal Engine Basics 06 - Animation, Audio, Visual Effects
Unreal Engine Basics 06 - Animation, Audio, Visual EffectsUnreal Engine Basics 06 - Animation, Audio, Visual Effects
Unreal Engine Basics 06 - Animation, Audio, Visual Effects
 
Game Programming - Cloud Development
Game Programming - Cloud DevelopmentGame Programming - Cloud Development
Game Programming - Cloud Development
 
Game Programming - Git
Game Programming - GitGame Programming - Git
Game Programming - Git
 
Eight Rules for Making Your First Great Game
Eight Rules for Making Your First Great GameEight Rules for Making Your First Great Game
Eight Rules for Making Your First Great Game
 
Designing an actor model game architecture with Pony
Designing an actor model game architecture with PonyDesigning an actor model game architecture with Pony
Designing an actor model game architecture with Pony
 
Game Programming 13 - Debugging & Performance Optimization
Game Programming 13 - Debugging & Performance OptimizationGame Programming 13 - Debugging & Performance Optimization
Game Programming 13 - Debugging & Performance Optimization
 
Scrum - but... Agile Game Development in Small Teams
Scrum - but... Agile Game Development in Small TeamsScrum - but... Agile Game Development in Small Teams
Scrum - but... Agile Game Development in Small Teams
 
What Would Blizzard Do
What Would Blizzard DoWhat Would Blizzard Do
What Would Blizzard Do
 
School For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine BasicsSchool For Games 2015 - Unity Engine Basics
School For Games 2015 - Unity Engine Basics
 
Tool Development A - Git
Tool Development A - GitTool Development A - Git
Tool Development A - Git
 
Game Programming 12 - Shaders
Game Programming 12 - ShadersGame Programming 12 - Shaders
Game Programming 12 - Shaders
 
Game Programming 11 - Game Physics
Game Programming 11 - Game PhysicsGame Programming 11 - Game Physics
Game Programming 11 - Game Physics
 
Game Programming 10 - Localization
Game Programming 10 - LocalizationGame Programming 10 - Localization
Game Programming 10 - Localization
 
Game Programming 09 - AI
Game Programming 09 - AIGame Programming 09 - AI
Game Programming 09 - AI
 
Game Development Challenges
Game Development ChallengesGame Development Challenges
Game Development Challenges
 
Game Programming 08 - Tool Development
Game Programming 08 - Tool DevelopmentGame Programming 08 - Tool Development
Game Programming 08 - Tool Development
 
Game Programming 06 - Automated Testing
Game Programming 06 - Automated TestingGame Programming 06 - Automated Testing
Game Programming 06 - Automated Testing
 
Game Programming 05 - Development Tools
Game Programming 05 - Development ToolsGame Programming 05 - Development Tools
Game Programming 05 - Development Tools
 
Game Programming 04 - Style & Design Principles
Game Programming 04 - Style & Design PrinciplesGame Programming 04 - Style & Design Principles
Game Programming 04 - Style & Design Principles
 
Game Programming 03 - Git Flow
Game Programming 03 - Git FlowGame Programming 03 - Git Flow
Game Programming 03 - Git Flow
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 

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 npruehs@outlook.com
  • 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?