UI Canvas
Every UI element you create must be a child of a UI Canvas. To see a list of all UI elements you can create within Unity, select + | UI from the Hierarchy window, as shown in the following screenshot:
Figure 6.1: The renderable UI elements within the Unity UI (uGUI) system
Every one of the UI items highlighted in the preceding screenshot is a renderable UI item and must be contained within a Canvas to render. If you try to add any of those UI elements to a scene that does not contain a Canvas, a Canvas will automatically be added to the scene, and the item you attempted to create will be made a child of the newly added Canvas. To demonstrate this, try adding a new UI Text element to an empty scene. You can do so by selecting + | UI | Text.
This will cause three new items to appear in the Hierarchy list: Canvas
, Text
, and EventSystem
, where the Text is a child of the Canvas.
Figure 6.2: The result of adding a UI Text...