Adding large textures such as backgrounds to the atlas isn't a good idea; you'll waste space on your atlas and won't gain performance since backgrounds aren't usually used very often.
A simple way to display large textures is to use the UITexture
component.
Let's use the UITexture
component to display a background for our menu:
UI Root
GameObject.UI Root
| GameObject
., which is empty and new.Background
.texture
with your keyboard to search for components.We've attached the UITexture
component to our Background
GameObject. We can now review its parameters before we configure it.
The newly added UITexture component has the following eight parameters:
UISprite
component, you can define if it's a Normal
, Sliced
, Tiled
, Filled
, or Advanced
sprite.Ok, we can now configure it to display a background for our UI.
We'll configure the UITexture
component to display a large texture as the UI background:
UI Root
| Background
GameObject.Resources/Textures/Poly_Background
in the Texture field.-5
.1920 x 1080
.Great. You should now have the polygon background image displayed as the background for our entire UI, as shown in the following screenshot:
Ok, good! The menu looks good. Now, let's summarize what you've learned in this chapter.
18.188.37.136