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 屬性中使用,決定縮放圖像的中心區域。
構建一個新的 矩形 ,有兩個零位置。