Book Image

Learning NGUI for Unity

By : Charles Bernardoff (EURO)
Book Image

Learning NGUI for Unity

By: Charles Bernardoff (EURO)

Overview of this book

Table of Contents (17 chapters)
Learning NGUI for Unity
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adding sprites to the atlas


Let's add more sprites to our new Game atlas. We'll add these three types of sprites:

  • Simple: A simple image is displayed onscreen, such as our play icon.

  • Sliced: The image is sliced in nine parts; the image is resizable without stretching corners.

  • Tiled: The tiling pattern is repeatable indefinitely.

Let's start with Simple sprites.

Simple sprites

It is time to add icons for our Options and Exit buttons. They are simple sprites used as icons that look like this:

Let's start by updating our Game atlas with these new sprites.

Updating the atlas

Ok, add our new sprites to our Game atlas by following these steps:

  1. Navigate to NGUI | Open | Atlas Maker.

    Note

    You can also open it with a right-click in the Project view.

  2. Make sure that our new Game atlas is selected, as shown in the following screenshot:

Now, within the Project view, select both our Icon_Options and Icon_Exit files located in Assets/Resources/Textures.

With our texture files selected in the Project view, you can...