Join Jesse Freeman for an in-depth discussion in this video Modifying padding and spacing, part of Unity 5: UI.
- Now let's take a look…at how padding works inside of a layout.…We'll go back to our horizontal layout group…and let's change the force child expand…to expand the height.…Now sometimes you might have a list…or you might have a row of objects…and you want to have a background inside of them.…One way we can do this…is by adding an image component to our layout group.…Now that we've created our image,…let's change the background color to black.…
A lot of the time…we would want to show the background as either a border…or we would want a little bit more spacing…from the edge of each object…around the border of its container.…If we go back into our horizontal layout group…we can manipulate the padding in order to achieve this.…Let's set everything to five.…Now we have a nice solid black border…around all of our objects.…One of the reasons we might want to use a background…to create a border…is that it's going to be a little bit more efficient…when the UI is being rendered.…
Also, we're able to set the background to an image perhaps,…
- Adding new components to the Canvas
- Working with RectTransforms
- Nesting UI elements
- Adding rich text and effects to the UI
- Creating images
- Styling UI buttons
- Handling input
- Creating sliders
- Controlling the layout of the screen
- Adding toggles and dropdowns
Skill Level Intermediate
1. The Canvas
2. Working with the RectTransform
3. Working with Text
4. Working with Images
5. Working with Buttons
6. Handling UI Input
7. Working with a Slider
8. Controlling Layout
9. Toggles, Dropdowns, and the Input Field
- 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.