Chapter 6. Putting a 2D GUI in a 3D game

This chapter covers

  • Comparing old (pre-Unity 4.6) and new 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 2D or 3D, first-person shooter or puzzle game.

These abstract interaction displays are referred to as the UI, or more specifically ...

Get Unity in Action 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.