Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Unity Game Development Blueprints

You're reading from   Unity Game Development Blueprints Explore the various enticing features of Unity and learn how to develop awesome games

Arrow left icon
Product type Paperback
Published in Nov 2014
Publisher
ISBN-13 9781783553655
Length 318 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
John P. Doran John P. Doran
Author Profile Icon John P. Doran
John P. Doran
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. 2D Twin-stick Shooter 2. Creating GUIs FREE CHAPTER 3. Side-scrolling Platformer 4. First Person Shooter Part 1 – Creating Exterior Environments 5. First Person Shooter Part 2 – Creating Interior Environments 6. First Person Shooter Part 3 – Implementing Gameplay and AI 7. Creating Save Files in Unity 8. Finishing Touches 9. Creating GUIs Part 2 – Unity's New GUI System Index

Adding in text


In addition to placing the health bar, to get some experience using text, let's use that as well:

  1. With the Canvas object selected, create a text object by navigating to GameObject | UI | Text.

  2. Now, it may be hard to see it being added at first, so let's first change the color of the text. Select the Text object, and go to its Text component. Once there, change the Color property to white:

    Note

    In the new UI system, objects are drawn in order, which means that if the text object was before the slider, the slider would cover the text. However, you can drag objects into whichever order you want.

  3. At this point, you'll notice that the text is actually backwards. Fixing this is very simple; just change the Rect Transform module on it to have a Y Rotation value of 180.

    Note

    Make sure this is done on the Text object, or your health will go down from right to left rather than left to right.

  4. For our purposes, we will have this be displayed in the center of our object. To do this, we can just...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime