7 Putting a GUI onto a game

This chapter covers

  • Comparing old (pre-Unity 4.6) and newer GUI systems
  • Creating a canvas for the interface
  • Positioning UI elements using anchor points
  • Adding interactivity to the UI (buttons, sliders, and so on)
  • Broadcasting and listening for events from the UI

In this chapter, you’ll build a 2D interface display for a 3D game. So far, we’ve focused on the virtual scene itself while building a first-person demo. But every game needs abstract interaction and information displays in addition to the virtual scene the gameplay takes place in. This is true for all games, whether they’re 2D or 3D, first-person shooters or puzzle games. So, while the techniques in this chapter will be used on a 3D game, they apply ...

Get Unity in Action, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.