官术网_书友最值得收藏!

Rect Transform component

As stated earlier, UI elements do not have the standard Transform component, they have the Rect Transform component. If you compare it to a standard Transform component, you will see that it has quite a few more properties.

You can use it to change the position, the rotation, and the scale, just as you can with the Transform, but there are the added properties of Anchor Presets (represented by the square image in the top left corner), two values for determining dimension: Anchor Min and Max points, and Pivot point.

It's important to note that the Scale value is considered the Local Scale. If you rescale the object with the Rect Tool, even with the Local positioning mode, the values within Scale will remain at 1.

You may have noted that the labels for the position and dimensional values are different on the preceding illustration than they were on the one provided in the UI Panel Properties section. This is because the labels that represent the position and dimension change depending on the Anchor Preset chosen. We'll discuss how to use these Anchor Preset momentarily, but let's look at some different examples of labels the position and dimensional values can hold.

If the Rect Transform has its Anchor Preset set to not include stretch, as with the top-left example in the preceding screenshot, the values for position are determined by Pos X, Pox Y, Pos Z, and the dimensions are determined by Width and Height.

If the Rect Transform has its Anchor Preset set to include stretch, as with the other three examples, the positions perpendicular to the stretch and the dimensions parallel to the stretch are labeled with Left, Right, Top, and Bottom. These values represent the offset from the border of the parent's Rect Transform.

The Anchor Point of an object determines the point from which all the relative positions are measured from. The Pivot Point determines the point from which the scaling and rotating modifiers happen. It will rotate around this point and scale toward this point. We will look at Anchors and Pivots more thoroughly in the Anchors and Pivot section.

主站蜘蛛池模板: 洮南市| 乌鲁木齐县| 财经| 永泰县| 莒南县| 厦门市| 临桂县| 方正县| 大同市| 彭山县| 鄱阳县| 太白县| 北碚区| 抚宁县| 西林县| 白沙| 天门市| 邯郸市| 莱芜市| 腾冲县| 樟树市| 孝义市| 浦城县| 钟祥市| 武胜县| 东光县| 右玉县| 灵山县| 无棣县| 昌邑市| 青州市| 鸡东县| 阳原县| 东乌珠穆沁旗| 六枝特区| 隆子县| 和顺县| 秦安县| 汶川县| 竹溪县| 辉南县|