▶Book Description
A functional UI is an important component for player interaction in every type of video game. Along with imparting crucial statistical information to the player, the UI is also the window through which the player engages with the world established by the game. Unity's tools give you the opportunity to create complex and attractive UIs to make your game stand out.
This book helps you realize the full potential of Unity's powerful tools to create the best UI for your games by walking you through the creation of myriad user interface components.
Learn how to create visually engaging heads-up-displays, pause menus, health bars, circular progress bars, animated menus, and more. This book not only teaches how to lay out visual elements, but also how to program these features and implement them across multiple games of varying genres.
While working through the examples provided, you will learn how to develop a UI that scales to multiple screen resolutions, so your game can be released on multiple platforms with minimal changes.
▶What You Will Learn
⦁ Design principles and patterns for laying out elements in your UI
⦁ Techniques that allow your UI to scale appropriately in different resolutions
⦁ How to use automatic layouts to streamline your UI building process
⦁ Properties of the Event System and how to appropriately hook events to your UI elements
⦁ Access the components and properties of UI elements via code
⦁ Implement all of Unity's built-in UI elements as well as those provided by TextMeshPro
⦁ Develop key UI components that are popularly used in multiple game genres
⦁ Add visual flare to user interfaces with the use of animation and particle effects
⦁ Create a UI that displays in the Screen Space as well as World Space
▶Key Features
⦁ Develop a game UI with both technical and aesthetic considerations
⦁ Use all the UI elements provided by Unity's UI system
⦁ Step-by-step examples of creating user interface components in the top game genres
▶Who This Book Is For
This book is for anyone keen to improve their games via a great user interface with Unity's UI system. If you're looking for a book that explains how to develop specific user interfaces or that thoroughly explains how each of the individual Unity components work, this book is for you.
▶What this book covers
⦁ Chapter 1, Designing User Interfaces, covers basic information related to designing user interfaces. Additionally, a detailed explanation of setting the aspect ratio and resolution of a Unity project is discussed.
⦁ Chapter 2, Canvases, Panels, and Basic Layouts, begins exploring the development of a user interface by appropriately laying out UI elements within a Canvas. Panels will be used and an introduction to Text and Images will be provided. The examples included in this chapter show how to lay out a basic HUD, create a permanent background image, and develop a basic pop-up menu.
⦁ Chapter 3, Automatic Layouts, discusses how to implement the various automatic layout components to streamline the UI building process. The examples included within this chapter utilize the automatic layout functionality to create a selection menu in the HUD and a gridded inventory.
⦁ Chapter 4, The Event System and Programming for UI, explains how to program interactions for graphical and hardware user interfaces. The examples covered in this chapter explain how to use the keyboard to make menus appear and disappear, how to pause the game, and how to create a drag and drop inventory system.
⦁ Chapter 5, Buttons, explores the various properties of buttons. The examples in this chapter walk through how to set up keyboard and controller navigation of buttons, how to load scenes when buttons are pressed, how to create animated button transitions, and how to make buttons swap their images.
⦁ Chapter 6, Text, Images, and TextMesh Pro-Text, discusses the properties of images and text more thoroughly and demonstrates how to affect their properties via code. The examples at the end of the chapter show how to create a dialog box with text that animates as if it was being typed in, how to create a custom font, how to make horizontal and circular progress meters/health bars, and how to create text that wraps with a gradient.
⦁ Chapter 7, Masks and Other Inputs, covers a myriad of UI inputs, as well as masks. Examples showing how to make a scrolling menu and a drop-down menu with images are covered at the end of the chapter.
⦁ Chapter 8, Animations and Particles in the UI, is all about animating the UI. The examples in this chapter show how to animate menus to fade in and out, and how to make a complex loot box animation with particles that appear in front of the UI elements.
⦁ Chapter 9, World Space UI, showcases how to create UI elements that exist within the game scene as opposed to on the "screen" in front of all in-game items. The examples cover how to create an interactive UI for a 2D scene and interactive, hover health bars for a 3D scene.
⦁ Chapter 10, Mobile-Specific UI, showcases interactions that are specific to mobile and touchscreen devices. The examples in this chapter show how to recognize when a portion of the screen is tapped on, how to zoom when the pinch action is performed, how to create press-and-hold or long-press interactions, and how to create static and floating on-screen control pads.