Examples

Now let's jump into some examples! We'll be creating a layout for a basic heads-up-display (HUD) and a background image that stretches with the screen and scales at multiple resolutions.

Before we begin setting up our UI, let's set up our project and bring in the art assets we will need.

We'll begin by setting up our project:

  1. Create a new Unity Project and name it Master Unity UI Project. Create it in the 2D mode.
We're selecting 2D Mode because it will make importing our UI sprites a lot easier. When in 2D Mode, all images import as Sprite (2D and UI) images rather than Texture images, as they do in 3D Mode. You can change to 3D Mode at any time by navigating to Edit | Project Settings | Editor and changing Mode to 3D.
  1. Create ...

Get Mastering UI Development with Unity 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.