了解其他玩家的情况可能很有趣。ProfileCard 开发者模块 是查看体验中其他玩家更多信息的良好方式,包括已获得的徽章以及玩家最喜欢的体验。
模块使用
安装
要在体验中使用 ProfileCard 模块:
从 Studio 的 窗口 菜单或 首页 选项卡工具栏中,打开 工具箱 并选择 创作者商店 选项卡。

确保选择了 模型 排序,然后点击 查看所有 按钮以查看 分类。

定位并点击 包 瓦片。
定位 个人资料卡 模块并点击它,或将其拖放到 3D 视图中。

在 资源管理器 窗口中,将整个 ProfileCard 模型移动到 ReplicatedStorage 中。运行体验后,模块将开始运行。
视图
个人资料卡有不同的视图,具体取决于您是在查看自己的卡片还是其他玩家的卡片。
当你第一次重生到体验中时,角色上方会出现一个图标。点击该图标会打开个人资料卡视图。关闭卡片后,图标会消失,但您可以随时通过点击您的角色重新打开卡片。

查看自己的卡片时,它看起来就像其他玩家看到的那样,除非空白字段会显示占位符文本。此外,状态字符串受 文本过滤 的限制,因为任何自由文本输入也应如此。




API 参考
函数
configure
configure(config: table)
通过 config 表中的以下键/值覆盖默认证配置选项。该函数应从 StarterPlayerScripts 中的 LocalScript 调用。
| 键 | 描述 | 默认值 |
|---|---|---|
| alwaysOnTop | 如果为 true,则在所有物体上方显示定位图标,防止它们被 3D 世界对象挡住。 | true |
| showPersonalIndicator | 如果为 true,则在玩家第一次加入体验时显示个人指示器。 | true |
| showBlur | 如果为 true,则在玩家进入编辑模式时显示模糊的屏幕背景。 | true |
| maxClickDistance | 角色被点击时,卡片从相机视点出现的最大距离,以 studs 为单位测量。 | 100 |
| backgroundColor | 卡片的背景颜色 (Color3)。 | [228, 255, 255] |
| backgroundTransparency | 卡片的 backgroundColor 的透明度。 | 0.2 |
| isScaled | 如果为 true,则自动调整文本的大小以填充空间的高度。 | false |
| isTruncated | 如果为 true,则自动隐藏超出适当查看范围的字符串的末尾。 | true |
| hasRoundedCorners | 如果为 true,则卡片的角会被圆化。 | false |
| cornerRadiusValue | 如果 hasRoundedCorners 为 true,则为 UICorner 的圆角半径值。 | 20 |
| hasBorder | 如果为 true,则为卡片显示边框。 | false |
| borderColor | 卡片边框的颜色 (Color3)。仅在 hasBorder 为 true 时适用。 | [228, 255, 255] |
| borderThickness | 如果 hasBorder 为 true,则为卡片边框的厚度。 | 3 |
| borderTransparency | 如果 hasBorder 为 true,则为卡片边框的透明度。 | 0 |
| borderLineJoinMode | 卡片边框的角样式 (Enum.LineJoinMode)。仅在 hasBorder 为 true 时适用。 | Round |
| headerFontSize | 卡片头部的字体大小。 | 18 |
| headerFontType | 卡片头部的字体类型 (Enum.Font)。 | GothamBlack |
| textFontSize | 卡片正文文本的字体大小。 | 15 |
| textFontType | 卡片正文文本的字体类型 (Enum.Font)。 | GothamMedium |
LocalScriptlocal ReplicatedStorage = game:GetService("ReplicatedStorage")local ProfileCard = require(ReplicatedStorage.ProfileCard)ProfileCard.configure({alwaysOnTop = true,maxClickDistance = 50,backgroundColor = Color3.fromRGB(0, 0, 0),backgroundTransparency = 0.4})