纹理和图标

*此内容使用人工智能(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 为其分配独特的资产 ID。

要将纹理或装饰添加到零件或组合:

  1. 探索器 窗口中,添加 TextureDecal 到部分或组合:

    1. 将鼠标悬停在零件或联盟上,单击⊕按钮。将显示上下文菜单。

    2. 从菜单中,插入 纹理贴花 。一个空的纹理或贴花对象显示在部分或联盟上,并用橙色轮廓显示。

  2. 属性 窗口中,导航到 属性并 选择面 或保留默认面。

  3. 选择 纹理 属性,并通过以下任意方法应用图像:

    • 选择您之前上传的任何纹理或装饰。
    • 纹理 字段中输入资产 ID。
    • 通过 添加图像... 按钮上传新图像。
  4. (可选) 通过单击左边的小盒子设置颜色调色或输入 RGB 颜色代验证码来设置颜色调色。

    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. (可选)透明 属性设置为任何值,介于默认值01之间。

    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 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()