Unity UI Cookbook

Over 60 recipes to help you create professional and exquisite UIs to make your games more immersive

Unity UI Cookbook

This ebook is included in a Mapt subscription
Francesco Sapio

5 customer reviews
Over 60 recipes to help you create professional and exquisite UIs to make your games more immersive
$0.00
$39.99
$49.99
$29.99p/m after trial
RRP $39.99
RRP $49.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 4,000+ eBooks & Videos
  • 40+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781785885822
Paperback284 pages

Book Description

With the increasing interest in game development, it's essential to design and implement a UI that reflects the game settings and shows the right information to the player. The Unity system is used to create complex and aesthetically pleasing user interfaces in order to give a professional look and feel to a game. Although the new Unity UI system is powerful and quite easy to use, by integrating it with C# scripts, it's possible to realize the potential of this system and bring an impressive UI to games.

This guide is an invaluable collection of recipes if you are planning to use Unity to develop a game. Starting with the basic concepts of the UI components, we’ll take you all the way through to creating complex interfaces by including animations and dynamics elements.

Based on real-world problems, these recipes will start by showing you how to make common UI elements such as counters and healthbars. You will then get a walkthrough of how to manage time using timers, and will learn how to format them. You will move on to decorating and animating the UI elements to vivify them and give them a professional touch. Furthermore, you will be guided into the 3D UI world and into HUD scripting. Finally, you will discover how to implement complex minimaps in the interface.

Table of Contents

Chapter 1: UI Essentials
Introduction
Setting up a 2D texture to be a bordered sprite
Resizing the UI according to the screen size and resolution
Adding and placing an image in the UI
Adding a circular mask to an image
Making an image scrollable
Making text scrollable with a vertical slider
Selecting buttons through the keyboard
Using UI layout components
Chapter 2: Implementing Counters and Health Bars
Introduction
Implementing a score counter
Implementing a lives counter
Creating a modular coin counter
Creating a symbolic lives counter
Implementing a linear health bar
Implementing a radial health bar
Creating a health bar with armor
Using multiple bars to make a multibar
Developing a kingdom hearts health bar style
Chapter 3: Implementing Timers
Introduction
Implementing a numeric timer
Creating a linear timer
Implementing a radial timer
Creating a mixed timer
Creating a well-formatted timer
Developing a well-formatted countdown that changes
Chapter 4: Creating Panels for Menus
Introduction
Creating a toggle group
Showing the slider value as a percentage
Adding upper and lower bounds to the slider
Making UI elements affected by different lights
Making a draggable panel
Making a resizable panel
Creating a drag-and-drop element
Developing an MP3 player
Chapter 5: Decorating the UI
Introduction
Creating an extendable element with a final fade effect
Creating an extendable and rotating element with a final fade effect
Creating bars that go up and down
Making a floating UI element
Adding shadows to text
Adding outlines to text
Chapter 6: Animating the UI
Introduction
Appearing and disappearing menu
Creating a menu with an entrance transition
Creating a menu with an idle animation
Animating a button when the cursor is over it
Creating a pop-up menu
Animating hearts of the symbolic lives counter
Changing animation of the hearts of the symbolic lives counter through the script
Chapter 7: Applying Runtime Customizations
Introduction
Making a button that changes color
Creating a slider that changes colors gradually
Creating a slide shower using a discrete slider
Creating a slider that changes a single color channel
Making an input field with personal text validation at runtime
Making an input field for a password with a lower bound limit for characters
Changing the cursor at runtime
Chapter 8: Implementing Advance HUDs
Introduction
Creating a distance displayer
Creating a directional radar
Developing a subtitle shower
Chapter 9: Diving into 3D UIs
Introduction
Creating a 3D menu
Adding a smooth tilt effect
Creating and placing a 3D UI
Making an animated 3D UI warning
Chapter 10: Creating Minimaps
Introduction
Creating a minimap
Implementing advanced features for minimaps

What You Will Learn

  • Implement different kinds of counters and healthbars
  • Deal with timers and find out how to format them
  • Animate and vivify UI elements
  • Handle runtime customizations
  • Add complex Head-up displays (HUDs)
  • Design and implement 3D UIs
  • Integrate minimaps in the UI

Authors

Table of Contents

Chapter 1: UI Essentials
Introduction
Setting up a 2D texture to be a bordered sprite
Resizing the UI according to the screen size and resolution
Adding and placing an image in the UI
Adding a circular mask to an image
Making an image scrollable
Making text scrollable with a vertical slider
Selecting buttons through the keyboard
Using UI layout components
Chapter 2: Implementing Counters and Health Bars
Introduction
Implementing a score counter
Implementing a lives counter
Creating a modular coin counter
Creating a symbolic lives counter
Implementing a linear health bar
Implementing a radial health bar
Creating a health bar with armor
Using multiple bars to make a multibar
Developing a kingdom hearts health bar style
Chapter 3: Implementing Timers
Introduction
Implementing a numeric timer
Creating a linear timer
Implementing a radial timer
Creating a mixed timer
Creating a well-formatted timer
Developing a well-formatted countdown that changes
Chapter 4: Creating Panels for Menus
Introduction
Creating a toggle group
Showing the slider value as a percentage
Adding upper and lower bounds to the slider
Making UI elements affected by different lights
Making a draggable panel
Making a resizable panel
Creating a drag-and-drop element
Developing an MP3 player
Chapter 5: Decorating the UI
Introduction
Creating an extendable element with a final fade effect
Creating an extendable and rotating element with a final fade effect
Creating bars that go up and down
Making a floating UI element
Adding shadows to text
Adding outlines to text
Chapter 6: Animating the UI
Introduction
Appearing and disappearing menu
Creating a menu with an entrance transition
Creating a menu with an idle animation
Animating a button when the cursor is over it
Creating a pop-up menu
Animating hearts of the symbolic lives counter
Changing animation of the hearts of the symbolic lives counter through the script
Chapter 7: Applying Runtime Customizations
Introduction
Making a button that changes color
Creating a slider that changes colors gradually
Creating a slide shower using a discrete slider
Creating a slider that changes a single color channel
Making an input field with personal text validation at runtime
Making an input field for a password with a lower bound limit for characters
Changing the cursor at runtime
Chapter 8: Implementing Advance HUDs
Introduction
Creating a distance displayer
Creating a directional radar
Developing a subtitle shower
Chapter 9: Diving into 3D UIs
Introduction
Creating a 3D menu
Adding a smooth tilt effect
Creating and placing a 3D UI
Making an animated 3D UI warning
Chapter 10: Creating Minimaps
Introduction
Creating a minimap
Implementing advanced features for minimaps

Book Details

ISBN 139781785885822
Paperback284 pages
Read More
From 5 reviews

Read More Reviews