Lesson 7
Show a picture: Sprite Renderer
Put your own picture in the game with a Sprite Renderer.
Draft lesson: nobody has followed it from start to finish in the editor yet, so a step may not match what you see.
Video coming soon
We are making a video for this lesson. For now, follow the steps below!
In this lesson you will
- Add a picture to your project
- Make a sprite
- Choose the picture it shows
What is a sprite?
A sprite is a picture in a game: a hero, a coin, a tree...
The Sprite Renderer is the component that draws it.
1. Add your picture
Drag a picture (a PNG or JPG file) from your computer onto the Assets panel.
2. Make a sprite
Click GameObject, then Sprite. You get a new GameObject that already has a Sprite Renderer.
3. Choose the picture
Click your sprite. In the Inspector, find the Sprite Renderer and choose your picture.
Good to know
- Too big or too small? Change the Scale in the Transform.
- PNG pictures can have a see-through background. They look best!
Try this
- Make a sprite for your player and one for the ground.
- Make the ground wide: set its Scale X to
5.
Try it here
Your mission
Pick a picture from the Assets panel and put it on the sprite.
Soon, a small piece of the editor will be right here, so you can practise without leaving the lesson. For now, try it in the editor!