UI Panel
The main function of UI Panels is to hold other UI elements. You can create a Panel by selecting + | UI | Panel. It’s important to note that there is no Panel component. Panels are really just GameObjects that have Rect Transform, Canvas Renderer, and Image components. So, really, a UI Panel is just a UI Image with a few properties predefined for it.
Figure 6.19: The components on a Panel GameObject
By default, Panels start with the Background Image (which is just a grey rounded rectangle) as the Source Image with medium opacity. You can replace the Source Image with another Image or remove the image entirely.
Panels are very useful when you are trying to ensure that items scale and are appropriately positioned relative to each other. Items that are contained within the same Panel will scale relative to the Panel and maintain their relative position to each other in the process.
We will look at the Image component more thoroughly...