紋理和裝飾品

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

A 是一個你可以放置在任何 部分 或 聯盟 上的圖像,該圖像會在表面尺寸上重複地垂直和水平地重複。相反地,Decal 是一個圖像, 伸展 以適應零件或聯聯集表面的區域。當您將 TextureDecal 對象添加到零件或聯聯集時,您可以:

  • 變更紋理或裝飾 Color3 屬性,設置使用 RGB 顏色代碼的顏色染色。

  • 將紋理或裝飾品 Transparency 屬性變更為值,介於預設值 0 (完全可見) 和 1 (隱形) 之間。

  • 對於紋理,設置其 比例偏移

    An example texture image of a light blue hexagon on top of a dark blue background.

    紋理圖像
    >

    The same blue texture repeated eight times on a block part.

    對零件應用的紋理(重複)
    >

    An example decal image of a light purple hexagon on top of a dark purple background.

    裝飾圖像
    >

    The same purple decal stretched on the top face of a block part.

    裝飾應用於零件(伸展)
    >

創建紋理或裝飾

要創建紋理或貼花,您必須將 TextureDecal 對象添加到零件或聯集上。您可以將圖像匯入Studio,用於在體驗之間使用,並將它們分發到創作者商店。一旦你匯入圖像,Studio 會為它分配獨特的資產ID。

要將紋理或裝飾添加到零件或聯集:

  1. 檢索器 窗口中,添加 TextureDecal 到零件或聯集:

    1. 將鼠標懸停在零件或聯盟上,然後單擊⊕按鈕。一個上下文選單顯示。

    2. 從選單中,插入 紋理貼花 。空白的紋理或貼花對象在零件或聯盟上顯示,並以橙色線條顯示。

  2. 屬性 窗口中,導航到 屬性和 選擇一個面 或保留預設面。

  3. 選擇 紋理 屬性,並通過以下任一方法應用圖像:

    • 選擇您以前上傳的任何紋理或裝飾。
    • 紋理 欄位中輸入一個資產ID。
    • 通過 新增圖像... 按鈕上傳新圖像。
  4. (可選) 通過單擊左側的小盒子設置顏色濃度或輸入 RGB 顏色代碼來設置顏色濃度 Color3 屬性。

    A close of view of the Color3 property with the small color box highlighted. A close of view of the Color3 property with the RGB code highlighted.
    A block part with a repeating blue hexagon texture on its top face.

    預設
    >

    The same block part with a repeating hexagon texture on its top face, but the hexagons are pink against on dark purple background.

    顏色3 = [255、0、100]
    >

  5. (可選)透明 屬性設為0的默認值和1的值之間的任何值。

    A block part with a repeating blue hexagon texture on its top face.

    預設
    >

    The same block part with a repeating hexagon texture on its top face, but the hexagons are semi-transparent.

    透明度 = 0.6
    >

選擇一個面

A 是一個部分/聯盟上的表面,顯示紋理或貼花: 。每個面的方向取決於零件或聯聯集的方向。在下列示例圖像中,相機面對方磚塊的 前面 ,因此方磚塊的 左面 正面從相攝影機的角度來看在右側。

A block part with a texture that displays on the block's front face. The Show Orientation Indicator highlights the block's front face orientation.

前端
>

A block part with a texture that displays on the block's top face. The Show Orientation Indicator highlights the block's front face orientation.

最頂
>

要選擇一個面:

  1. (可選) 以協助選擇正確的面,右鍵單擊零件/聯盟並選擇 顯示方向指示器 。這會顯示一個藍色圓圈,裡面有 F 和一條連接到對物件 前面 的線,以及一個綠色箭頭指向對物件 頂部 的方向。

  2. 選擇一個紋理或裝飾,它是零件或聯集盟的子孫。

  3. 屬性 窗口中,單擊 屬性並選擇一個面。

自訂紋理

與裝飾不同,紋理提供進一步的功能來比例放、抵消和動畫圖像。

縮放紋理

零件的尺寸不會影響紋理。相反,縮放零件只會增加或減少紋理重複的次數。

StudsPerTileUStudsPerTileV 屬性決定每個"磚塊"的尺寸,以磚格為單位。StudsPerTileU 決定紋理的水平尺寸,而StudsPerTileV 決定紋理的垂直尺寸。

An example texture image of a light blue hexagon on top of a dark blue background.

紋理圖像
>

The same texture on a surface of 8x6 studs with size of each tile in 2x2.

8×6 格子表面
>

The same texture on a surface of 8x6 studs with size of each tile in 4x4.

8×6 格子表面
>

要縮放紋理:

  1. 選擇一個紋理,它是零件的子紋理。

  2. 屬性 窗口中,設置 StudsPerTileUStudsPerTileV 到您希望紋理在縱向和橫向佔用的磚塊數。數字越大,圖像越大。

抵消紋理

如果您想獲得更多控制紋理位置的權限,請通過調整 OffsetStudsUOffsetStudsV 屬性來抵消紋理。這也有助於 動畫

An example texture image of a light blue hexagon on top of a dark blue background.

紋理圖像
>

The same texture on a surface of 8x6 studs with an offset of 1 stud.

8×6 格子表面
>

The same texture on a surface of 8x6 studs with an offset of 1.5 studs.

8×6 格子表面
>

要抵消紋理:

  1. 選擇一個紋理,它是零件的子紋理。

  2. 屬性 窗口中,設置 OffsetStudsUOffsetStudsV 到你想要垂直和水平抵消紋理的磚塊數量。

動畫紋理

使用 TweenService ,您可以將紋理特性,例如 OffsetStudsUStudsPerTileV 轉換為動畫表面。例如,如果您將兩個霧紋理應用到一個容器並使用以下腳指令碼進行動畫,您可以達到分層移動霧的外觀:

靠近地面的兩個動畫紋理來模擬移動霧效

local TweenService = game:GetService("TweenService")
local texture1 = script.Parent.Texture1
local texture2 = script.Parent.Texture2
local tweenInfo1 = TweenInfo.new(8, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, -1)
local tween1 = TweenService:Create(texture1, tweenInfo1, {OffsetStudsV=50})
local tweenInfo2 = TweenInfo.new(7, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, -1, true)
local tween2 = TweenService:Create(texture2, tweenInfo2, {OffsetStudsU=50, StudsPerTileU=55, StudsPerTileV=45})
tween1:Play()
tween2:Play()