关于RectTransform的理解

RectTransform

pivot

The normalized position in this RectTransform that it rotates around.

理解:矩形的中心点,归一化坐标(相当于自身矩形长宽比例的坐标)
例如,(0,0)表示矩形的左下角,(1,1)为右上角

rect

The calculated rectangle in the local space of the Transform.
Transform 的本地空间中计算的矩形

理解

// rect : UnityEngine.Rect
// x,y:自身矩形左下角相对Pivot点的坐标,即以RectTransform的pivot点为原点的坐标系中,左下角的坐标
// width,height:矩形宽度和高度

rect只跟自身中心点pivot位置和自身长宽有关,与本身在父节点中的位置无关
表示的是相对中心点的矩形位置和大小
所以不能通过修改rect达到移动位置的目的

anchors

理解:anchors为锚定到父节点上的矩形的两个点,左下角和右上角
这两个点是在父节点RectTransform中的归一化坐标,可以超出父节点大小

anchorMin

The normalized position in the parent RectTransform that the lower left corner is anchored to.

理解:左下角在父节点RectTransform中的归一化坐标(0~1)

anchorMax

The normalized position in the parent RectTransform that the upper right corner is anchored t

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值