Add images to your UI
Add pictures or a simple rectangle to your user interface (UI) as a background or visual element.
阅读时间1 分钟最后更新于 2 天前
You can use image elements to display photos, company logos, product diagrams, custom icons, and more. You can also use simple colored rectangles to create backgrounds.
This guide explains how to add basic colored shapes to your UI Canvas and how to import and place your own custom image files.
Add a rectangle and change its color
To add a simple rectangle to your UI and change its color:
- In the Hierarchy panel, select your UI Canvas.
- Right-click and choose UI > Image to create a new image element
- In the Inspector panel, select the Color property and choose a color for your image element.
Add your own image
To add your own image to the UI:
- In the Project panel, select Import Assets.
- Select your current project in the Projects panel.
- Select Add and choose an image file (PNG, JPG, or JPEG) from your device.
- Select Upload to add the image to the project.
- Choose the images you want to import and select Import. Unity Studio adds the images to the My Assets folder in the Project panel.
- In the Hierarchy panel, select your UI Canvas.
- Drag your uploaded image from the My Assets folder in the Project panel onto the canvas in the Scene view.