From the course: Unity 5: UI

Unlock this course with a free trial

Join today to access over 22,400 courses taught by industry experts.

Working with RectTransforms

Working with RectTransforms - Unity Tutorial

From the course: Unity 5: UI

Working with RectTransforms

- Now, let's talk a little bit more about direct transform that each of our UI components has. Let's go back into our UI intro scene and let's select our button. We'll also show direct transform properties in the inspector. And before we dig into this, let's switch back over to 2D mode and also focus on our button. Direct transform is made up of several properties. The most important one is going to be at the top, which is our positions, as well as the width and height. Now, this depends a lot on how our anchors are set up. Right now, because our Rect Transform is centered, we have a position x, a position y, a position z, and a width and a height. There are templates that change the anchor presets. Each of these effect the way that our button is laid out. We're going to dive a little bit more into the anchors in the next video. But it's important to note, as you change the anchor type you may also change the way that you're able to lay out the x and y position. If you stretch out the…

Contents