Rect 描述 2D 平面上的长方形。它由两个角、两个 Vector2 位置或四个数字组成:
local rect1 = Rect.new(Vector2.new(10, 10), Vector2.new(80, 80))local rect2 = Rect.new(10, 10, 80, 80)
该数据类型在 ImageLabel.SliceCenter 属性中使用,决定缩放图像的中心区域。
概要
构造工具
构造工具
new
构建一个新的 矩形 与两个零位置。
Rect 描述 2D 平面上的长方形。它由两个角、两个 Vector2 位置或四个数字组成:
local rect1 = Rect.new(Vector2.new(10, 10), Vector2.new(80, 80))local rect2 = Rect.new(10, 10, 80, 80)
该数据类型在 ImageLabel.SliceCenter 属性中使用,决定缩放图像的中心区域。
构建一个新的 矩形 与两个零位置。