Rect

顯示已棄用項目

*此內容是使用 AI(Beta 測試版)翻譯,可能含有錯誤。若要以英文檢視此頁面,請按一下這裡

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

構建一個新的 矩形 ,有兩個零位置。

new

建造新的 矩形 給予兩個 Vector2 位置:min 作為左上角,max 作為右下角。

參數

min: Vector2
max: Vector2

new

使用 **** 和 minX 作為左上角的坐標,以及 minYmaxX 作為右下角的坐標,建造新的 maxY

參數

minX: number
minY: number
maxX: number
maxY: number

屬性

Width

在像素中的 矩形 的寬度。

Height

在像素中的 矩形 高度。

左上角。

右下角。