O'Reilly logo

Mastering Unity 2017 Game Development with C# - Second Edition by Alan Thorn

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The canvas

On creating a canvas object, you can now build a user interface. First, let's fix the resolution of our game to 16:9 from the Game tab. This will be important to preview the UI in screen space at an appropriate aspect ratio. To do this, switch to the Game tab and choose 16:9 as the screen aspect ratio:

Setting aspect ratio

Now, select the canvas object. From the object Inspector, set the Render Mode to Screen Space - Overlay, via the Canvas component, if this mode is not already selected. In this mode, the UI on the selected canvas appears on top of everything, literally. It is the highest rendered object and needs no camera for ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required