Join Jesse Freeman for an in-depth discussion in this video Stretching UI elements, part of Unity 5: UI.
- Let's say we want a UI element, to expand…and stretch out based on the screen resolution.…If we go into the anchor presets…for our button and hold down option…on the Mac or ALT the PC,…you can select the fill screen button.…Now let's reset the position,…to left zero, top zero, right zero, and bottom zero.…As you can see, our button is now…filling the entire screen resolution.…Let's say we only want the button…to scale along the bottom of our screen.…
If we go back into the anchor presets…and holding down option or ALT,…we can select the bottom stretch.…Once we do that, we can reset our y postion…to zero, and we can now change our height to 50.…Here you'll see that the button is now…aligned but it's showing up below the screen.…If we change our pivot y to zero,…and reset the position y to zero,…you'll now get a button that stretches…across the bottom of the screen.…
The difference between vertically stretching…or horizontally stretching simply means…you'll either change the width of the object,…or the height of the object respectively.…
- 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.