Canvases, Panels, and Basic Layouts
As discussed in the previous chapter, the majority of this text will focus on the Unity UI system, uGUI. Canvases are the core of all UI made with Unity UI. Every single uGUI element must be contained within a Canvas for it to render within a scene. It works similarly to a canvas on which an artist paints, but instead of painting on them, we lay out UI elements on them. So, we’ll start our exploration of the various UI elements provided in the uGUI system with Canvases.
Canvases serve the purpose of not only holding all the UI elements within them but also determining how the elements will render and how they will scale. It’s important to start focusing on setting up a UI that will scale at multiple resolutions and aspect ratios early on, as trying to do so later will cause a lot of headaches and extra work. Therefore, we will also discuss how to make sure our UI scales appropriately.
In this chapter, we will discuss the following...