Create a button prefab

- [Voiceover] Now we're ready to create a button…that we can use throughout our UI.…Let's go back to our Canvas,…and create a Button inside of it.…We're gonna change the width and height…to make this match the rest of our UI.…Let's set the width to 80 and the height to 18,…and we can move it over to the side,…so it's not running into our other text objects.…From here, let's change the Source Image to "button-up".…Now as you can see, our button doesn't look quite right.…

Let's select the texture itself, and…go into our button-up settings.…If we go into the Sprite Editor, and expand it out,…we're gonna be able to change something called the "Border"…which will allow this image to scale…while leaving some parts of it not scaling.…To explain how this works,…let's start dragging in from the edges.…Here you'll see that I'm moving…the border to the inside of this button,…so that the left, top, right, and bottom all equal three.…

Each platform has a different way of describing this.…You may have called it 9-slicing or scale nine,…

Resume Transcript Auto-Scroll

Author

Updated

9/6/2016

Released

3/30/2016

One of the most important aspects of any game is its UI. Your players spend the majority of their time navigating between different game screens, selecting options, and reviewing game progress. This course addresses some ways to build and design the user interface of a game with Unity's new UI system. Here you'll tackle the start screen, game over screen, difficulty window, and virtual keyboard—common components of most popular 2D and 3D games.

Unity expert Jesse Freeman helps you design your UI using custom prefabs (reusable UI elements), UI components such as windows and buttons, simple buildup animations, and transitions. He also helps you create a window manager to guide changes and relationships between windows, and extend the window system with a custom Unity editor that lets you standardize window display and navigation throughout your game.