返回介绍

RectTransform.SetSizeWithCurrentAnchors 设置当前锚点的大小

发布于 2019-12-18 15:38:24 字数 1163 浏览 2206 评论 0 收藏 0

JavaScript => public function SetSizeWithCurrentAnchors(axis: RectTransform.Axis, size: float): void;
C# => public void SetSizeWithCurrentAnchors(RectTransform.Axis axis, float size);

Parameters 参数

axisThe axis to specify the size along.
sizeThe desired size along the specified axis.

Description 描述

Makes the RectTransform calculated rect be a given size on the specified axis.

使矩形变换计算矩形在指定坐标轴上是给定大小。

This method produces the given size with the current anchoring. If the parent RectTransform changes size, the size of the rect may change. If the size is meant to stay, either the RectTransform anchors should be set not to stretch, or this method should be invoked again whenever the parent size changes.

该方法随着当前锚点产生指定大小。如果父矩形变换改变大小,那么该矩形的大小也可能改变。如果该大小保持不变,那么矩形变换锚点应该设置为不延展,或者无论该父物体大小怎样改变,都避免再次调用该方法。

recttransform

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文