万本电子书0元读

万本电子书0元读

顶部广告

Mastering UI Development with Unity电子书

售       价:¥

4人正在读 | 0人评论 9.8

作       者:Ashley Godbold

出  版  社:Packt Publishing

出版时间:2018-04-30

字       数:41.7万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Master Game UI system by creating captivating user interface components with Unity 5 through Unity 2018 and C#. Learn about UI texts, images, world space UI, mobile-specific UI and much more. About This Book ? 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 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 In Detail 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. Style and approach The book walks you through the process of creating many different user interface components, by describing each UI component and property thoroughly and then providing step-by-step examples of its implementation. You will not only learn how to lay out visual elements, but you will also learn how to program for these features and hook them in to your game. The examples provided in the book can be reused for many other products.
目录展开

Title Page

Copyright and Credits

Mastering UI Development with Unity

Packt Upsell

Why subscribe?

PacktPub.com

Contributors

About the author

About the reviewer

Packt is searching for authors like you

Preface

Who this book is for

What this book covers

To get the most out of this book

Download the example code files

Download the color images

Conventions used

Get in touch

Reviews

Designing User Interfaces

UI and GUI

Four game interface types

Layout

Color schemes

Interface metaphors

Resolution and aspect ratio

Changing the aspect ratio and resolution of the game view

Building for a single resolution

Resetting the resolution

Method 1 – PlayerPrefs.DeleteAll()

Method 2 – Deleting PlayerPref files

Building for a single aspect ratio

Setting the orientation

Summary

Canvases, Panels, and Basic Layouts

UI Canvas

Rect Transform component

Canvas component

Screen Space-Overlay

Screen Space-Camera

World Space

Canvas Scalar component

Constant Pixel Size

Scale with Screen Size

Constant Physical Size

World

Graphic Raycaster component

Canvas Renderer component

UI Panel

Rect Transform

Rect Tool

Positioning modes

Rect Transform component

Rect Transform edit modes

Anchor and Pivot Point

Canvas Group component

Introducing UI Text and Image

Examples

Laying out a basic HUD

Placing a background image (2D game)

Setting up a basic pop-up menu

Summary

Automatic Layouts

Types of Automatic Layout Groups

Horizontal Layout Group

Padding

Spacing

Child Alignment

Control Child Size

Child Force Expand

Vertical Layout Group

Grid Layout Group

Cell Size

Start Corner and Start Axis

Constraint

Layout Element

Ignore Layout

The Width and Height properties

Min Width and Height

Preferred Width and Height

Flexible Width and Height

Fitters

Content Size Fitter

Aspect Ratio Fitter

Examples

Laying Out an HUD Selection Menu

Laying Out a Grid Inventory

Summary

The Event System and Programming for UI

Accessing UI elements in code

UnityEngine.UI namespace

UI variable types

The Event System

Event System Manager

First Selected

Send Navigation Events

Drag Threshold

Input Manager

Input functions for buttons and key presses

GetButton

GetAxis

GetKey

GetMouseButton()

Input Modules

Standalone Input Module

Hololens Input Module

Base Input Module/Pointer Input Module

Event Trigger

Event Types

Pointer events

Drag and Drop events

Selection events

Other events

Adding an action to the event

Event inputs

Raycasters

Graphic Raycaster

Other Raycasters

Examples

Showing and hiding pop-up menus with keypress

Using KeyCode with the Inventory Panel

Using Input Manager with the pause panel

Pausing the game

Dragging and dropping inventory items

Summary

Buttons

UI Button

Button component

Transitions

None

Color Tint

Sprite Swap

Animation

Navigation

Examples

Navigating through Buttons and using First Selected

Laying out the Buttons

Setting the explicit navigation and First Selected

Loading scenes with Button presses

Button Animation Transitions

Mute buttons with image swap

Summary

Text, Images, and TextMesh Pro-Text

UI Text

Text component

The Text and Character properties

Paragraph properties

The Color and Material properties

Raycast Target properties

Markup format

Font style

Font color

Font size

Importing new fonts

Font Size

Rendering Mode

Character

Ascent Calculation Mode

Dynamic font settings

Importing font styles

Custom fonts

UI Image

Image component

Image Type

Simple

Sliced

Tiled

Filled

UI effect components

Shadow

Outline

Position as UV1

TextMesh Pro-Text

Text Input Box

Font Settings

Extra Settings

Examples

Animated text

Creating a Background Canvas prefab and a new scene

Laying out the Text Box Windows

Animating the Text Box text

Custom font

Adjusting the character spacing and changing the font size

Horizontal and circular health/progress meters

Horizontal health bar

Circular progress meter

Wrapped text with Gradient

Summary

Masks and Other Inputs

Masks

Mask component

Rect Mask 2D component

UI Toggle

Toggle component

Toggle default event – On Value Changed (Boolean)

Toggle Group component

UI Slider

Slider component

Slider default event – On Value Changed (Single)

UI Scrollbar

The Scrollbar component

Scrollbar default event – On Value Changed (Single)

UI Scroll View

Scroll Rect component

Movement properties

Properties concerning scrolling speed

Properties of the Scrollbars

Scroll Rect default event – On Value Changed (Vector2)

UI Dropdown and TextMeshPro – Dropdown

Dropdown Template

The Dropdown component

Caption properties

Template properties

Option properties

Dropdown default event – On Value Changed (Int32)

UI Input Field

Input Field component

Properties of entered text and onscreen keyboards

Content Types

Line Types

Input Types

Keyboard Types

Character Validation options

Properties of the caret and selection

Input field default events – On Value Changed (String) and On End Edit (String)

TextMeshPro – Input Field

TMP_Input Field component

Input Field settings

Control settings

TextMeshPro - Input Field default events – On Select (String) and On Deselect (String)

Examples

Making a scroll view from a pre-existing menu

Creating a dropdown menu with images

Laying out the dropdown with caption and item images

Using the information from the dropdown selection

Summary

Animations and Particles in the UI

Animation clips

Animation Events

Animator Controller

The Animator of Transition Animations

Animator layers

Setting Animation Parameters in scripts

Animator behaviours

Particles in the UI

Examples

Animating pop up windows to fade in and out

Setting up the animations

Setting the Animator's Parameters with code

Animating a complex loot box with Particle System

Setting up the animations

Creating a Particle System that displays in the UI

Building a State Machine and timing the animations

Summary

World Space UI

When to use World Space

Appropriately scaling text in the Canvas

Other considerations when working in World Space

Examples

2D World Space status indicators

3D hovering health bars

Summary

Mobile-Specific UI

Recommended button sizes

Full screen/screen portion taps

The thumb zone

Multi-touch input

Accelerometer and gyroscope

Device resources

Examples

Adding press-and-hold/long-press functionality

Creating a static four-directional virtual D-pad

Creating a floating eight-directional virtual analog stick

Setting up the eight-directional virtual analog stick

Making the eight-directional virtual analog stick float

Summary

Other Books You May Enjoy

Leave a review - let other readers know what you think

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部