Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Unity Game Development Blueprints
  • Table Of Contents Toc
  • Feedback & Rating feedback
Unity Game Development Blueprints

Unity Game Development Blueprints

By : John P. Doran
4 (6)
close
close
Unity Game Development Blueprints

Unity Game Development Blueprints

4 (6)
By: John P. Doran

Overview of this book

If you want to build enticing projects with Unity, this book is for you. Readers who are familiar with the basics of how to create simple projects in Unity will have an easier time.
Table of Contents (11 chapters)
close
close
10
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...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech

Create a Note

Modal Close icon
You need to login to use this feature.
notes
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Delete Note

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Edit Note

Modal Close icon
Write a note (max 255 characters)
Cancel
Update Note

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY