NGUI for Unity

The NGUI plugin for Unity makes user interfaces so much more efficient and attractive. Learn all about it in this step-by-step tutorial that includes lots of practical exercises, including creating a fun 2D game.

NGUI for Unity

Starting
Charles Pearson

The NGUI plugin for Unity makes user interfaces so much more efficient and attractive. Learn all about it in this step-by-step tutorial that includes lots of practical exercises, including creating a fun 2D game.
$20.99
$34.99
RRP $20.99
RRP $34.99
eBook
Print + eBook
$12.99 p/month

Get Access

Get Unlimited Access to every Packt eBook and Video course

Enjoy full and instant access to over 3000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

+ Collection
Free Sample

Book Details

ISBN 139781783558667
Paperback182 pages

About This Book

  • Acquire complete knowledge of every component of NGUI
  • Design and customize a fully functional main menu aided by step by step instructions
  • Create an exciting 2D sci-fi game

Who This Book Is For

If you are a Unity 3D developer looking forward to learn NGUI for Unity, then this book is for you. Prior knowlege of C# scripting is expected. Additional knowledge of Unity 3D Editor, GameObject and creating/adding scripts to GameObject would be beneficial; however, no prior knowledge of NGUI is required.

Table of Contents

Chapter 1: Getting Started with NGUI
What is NGUI?
Importing NGUI
Creating your UI
Your UI structure
Summary
Chapter 2: Creating Widgets
Creating our first widget
Sprites
Labels
Buttons
Text input
Slider
Toggle
Popup list
Summary
Chapter 3: Enhancing your UI
NGUI components
The draggable panel
The drag-and-drop system
Animations with NGUI
Scrollable text
Localization system
Summary
Chapter 4: C# with NGUI
Events methods
Tween methods
Using keys for navigation
Error notification
Saving the nickname
Sending messages
Forwarding an event
Summary
Chapter 5: Building a Scrollable Viewport
Preparing the Game scene
The scrollable viewport
Creating draggable barriers
Creating an ActiveBarrier prefab
BarrierObject cooldown
The barrier availability tool tip
Summary
Chapter 6: Atlas and Font Customization
The Atlas prefab
Creating a new Atlas
Adding sprites to Atlas
Adding a font
Customizing the MainMenu
Summary
Chapter 7: Creating a Game with NGUI
Enemy spawning
Handling enemy collisions
Creating self-destruct code
Summary

What You Will Learn

  • Download and import NGUI
  • Construct a basic user interface: buttons, sprites, text inputs, lists, sliders, and more
  • Enhance your UI using clipping, draggable panels, content alignment, animations, and localization
  • Use C# with NGUI to save options, implement volume modification, launch animations, and change variables
  • Build a scrollable viewport with a drag-and-drop system
  • Create tooltips and notifications
  • Add your sprites and fonts to customize your main menu
  • Move elements through code and handle collisions to create a game

In Detail

NGUI is an effective plugin for Unity that gives you the power to create beautiful and complex user interfaces while reducing performance costs. It is a powerful UI system and event notification framework for Unity (both Pro and Free) written in C# featuring clean code and a simple, minimalistic approach to everything. You can create a main menu for your game and add sliders, animations, checkboxes, and popup lists, as well as localize your text.

This is an example-oriented, step-by-step, practical tutorial that will guide you through creating a fully functional main menu along with a 2D game. You will acquire the knowledge to create user interfaces for your existing and future PC or mobile games developed with Unity 3D. The book will start by teaching you the basic functions of the tools and how to create a basic UI. Later in the book, you will also learn how to create a much more complex UI.

This book will start by getting you acquainted with NGUI’s workflow and will then gradually take you through building a complex menu and creating a 2D game.

To achieve this, you will create and configure text labels, sliders, and checkboxes along with drag-and-drop systems. You will be exposed to advanced topics like C# with NGUI, and you will also learn how to build a scrollable viewport. By the end of this book, you will have acquired all the knowledge you need to create UIs with the help of practical steps supported by screenshots.

Authors

Table of Contents

Chapter 1: Getting Started with NGUI
What is NGUI?
Importing NGUI
Creating your UI
Your UI structure
Summary
Chapter 2: Creating Widgets
Creating our first widget
Sprites
Labels
Buttons
Text input
Slider
Toggle
Popup list
Summary
Chapter 3: Enhancing your UI
NGUI components
The draggable panel
The drag-and-drop system
Animations with NGUI
Scrollable text
Localization system
Summary
Chapter 4: C# with NGUI
Events methods
Tween methods
Using keys for navigation
Error notification
Saving the nickname
Sending messages
Forwarding an event
Summary
Chapter 5: Building a Scrollable Viewport
Preparing the Game scene
The scrollable viewport
Creating draggable barriers
Creating an ActiveBarrier prefab
BarrierObject cooldown
The barrier availability tool tip
Summary
Chapter 6: Atlas and Font Customization
The Atlas prefab
Creating a new Atlas
Adding sprites to Atlas
Adding a font
Customizing the MainMenu
Summary
Chapter 7: Creating a Game with NGUI
Enemy spawning
Handling enemy collisions
Creating self-destruct code
Summary

Book Details

ISBN 139781783558667
Paperback182 pages
Read More