In this video, Jesse Freeman teaches you how to expand your repeating background texture to fill the screen at different resolutions. You'll learn how to get Unity's actual screen size and stretch a texture to fill it. Working with repeating textures, quads and GameObject's dimensions in Unity 5 are important skills for building a 2D game.
- [Voiceover] So now lets take a look…at how we can get this texture to fill up…the screen and repeat.…We'll change the quads name to background,…and now let's take a look at its transform.…Our scale is set to 32 by 32.…If we were to make this 10 times larger…by multiplying it by 10, we could haVe 320 by 320.…Now we'll zoom out a little bit,…and what you'll see is that instead of this repeating,…it actually just grew larger.…In order for this to actually work,…we need to go to the material itself…and change the tiling value.…
Here we need to set this to 10 by 10.…Now you'll see our textures'srepeating,…but of course we can't do this all the time…for every single screen resolution.…We're gonna need to create a script…that takes the resolution into account,…and then automatically sizes up our quad…and changes the tiling value on the material.…So let's reset this all back.…We'll make sure that the tiling is one,…and back in our game,…we'll reset the background to 32 by 32.…
Let's go into our scripts folder…and create a new script called tiled background.…
Start watching to learn how to convert artwork into sprites, create repeating background textures with Unity's TexturePacker, and build reusable game objects such as players, obstacles, and enemies. Jesse also covers the basics of object pooling, working with custom UI components, and multiplatform publishing.
- Importing artwork
- Editing sprites
- Creating repeating background textures
- Building reusable obstacles
- Recycling game objects
- Building an object pool
- Creating the player
- Starting and ending the game
- Displaying and saving the score
- Adding menus and text
- Publishing a Unity game in different formats
Skill Level Beginner
1. Working with Sprites
2. Creating Repeating Textures
3. Creating Obstacles
4. Object Pooling
5. Creating the Player
6. Setting Up the Game
7. Polishing the Game
8. Creating More Obstacles
Publish to different formats5m 42s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.