Recording and displaying clicks

Now that we have this foundational button working, let's add some text to display information to the player.

  1. Go to GameObject | UI |Text. From there, use the Anchor Presets tool, hold down Alt + Shift, and click on the top-center option. It may be hard to see, so let's fix that up next. Change the Width to 1920 and Height to 100. You will remember that 1920 is what we used in our Reference Resolution, so this will take up the entire size.
  2. Then, change the Font Size to 75 and then change the Paragraph Alignment to be centered horizontally, change the Text Color to white, change the Text to You have: $0, and rename the Text object to CashText:
  3. Now select the CashText object and duplicate it (Ctrl+D) and give it a name ...

Get Unity 5: Learning C# by Developing Games now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.