基本的 框架 作為其他 Gui物件 的容器,例如 標籤 和 按鈕。您可以將框架應用於用戶的 螢幕 或遊戲中的 表面 上顯示。

框架是理想的容器,用於響應式佈局,例如 列表和彈性佈局,允許您改變框架的大小並動態調整佈局項目在其中的適應方式。框架 也是核心的 Gui物件,因此您可以自定義屬性,例如 背景顏色3、透明度,應用 背景漸變 或 邊框,等等。
除了作為容器的常見用途外,您還可以將 框架 用於 UI 設計。例如,作為其他 UI 元素之間的視覺分隔符,您可以將框架縮放為細長的形狀,直到它變成一條線。
剪裁
By default, GuiObject containers clip their content (descendant GuiObjects) through the ClipsDescendants boolean. If you want descendants to appear outside of a container's bounds, simply set ClipsDescendants to false.


Importantly, StarterGui.ClipsDescendantsSupportsRotation must be true for clipping to work on rotated descendants (non‑zero Rotation) within the container. However, clipping by a rotated container (clipping container itself is rotated) or by rounded corners (UICorner) is not supported. If you need clipping on rotated or rounded containers, consider CanvasGroup.

Rotation = 0

Rotation = 10
自動調整大小
框架可以根據其內容設置為 自動調整大小。要實現這一點,將框架的 大小 設置為 最小 寬度和/或高度,然後將其 自動大小 屬性設置為 X、Y 或 XY,具體取決於自動調整大小應該應用於哪個軸。一旦設置,框架將根據其中的 Gui物件 和佈局的大小自動調整大小。