SusHudMinimapFrame

小地图控件的方形外框 — 占位文字,或插槽 / 注入内容。
包
SusGame · HUD(商业)
属性
| 名称 | 类型 | 默认值 | |
|---|---|---|---|
PlaceholderText | Prop<string> | "Minimap" | |
ShowPlaceholder | Prop<bool> | true | |
FrameSize | Prop<float> | 160f | |
Shape | Prop<string> | "square" | |
Size | Prop<string> | "default" |
插槽
| 名称 |
|---|
(默认) |
事件
没有公开事件。
样式钩子
USS 类契约 — 无需改 C# 即可覆盖外观。状态通过这些类切换:
sus-hud-minimap-framesus-hud-minimap-frame__contentsus-hud-minimap-frame__placeholdersus-hud-minimap-frame--circlesus-hud-minimap-frame--squaresus-minimap--fit
用法
csharp
var frame = new SusHudMinimapFrame();
frame.FrameSize.Value = 140f;
frame.PlaceholderText.Value = "Minimap";
frame.ShowPlaceholder.Value = true;
// After your map visual exists:
// frame.SetContent(minimapRoot); // clears placeholderxml
<template>
<sus:SusHudMinimapFrame :PlaceholderText="Placeholder.Value"
:ShowPlaceholder="ShowPh.Value"
:FrameSize="Size.Value">
<!-- Optional default slot: your minimap VisualElement tree -->
</sus:SusHudMinimapFrame>
</template>
<script>
public Prop<string> Placeholder = new("Minimap");
public Prop<bool> ShowPh = new(true);
public Prop<float> Size = new(140f);
</script>| Prop / API | 作用 |
|---|---|
PlaceholderText | 空状态下的文字(默认 Minimap) |
ShowPlaceholder | 显示 / 隐藏占位内容 |
FrameSize | 宽高(≤40 时回退到 140) |
| default slot | 外框内的嵌套内容 |
SetContent(ve) | 替换宿主子级 + 隐藏占位内容 |
备注
- 外框只提供外观 —— 绘制 / 战争迷雾 / 图标位于你的内容中,或来自 SusMinimap(如果使用)。
- 注入内容后,
SetContent会将ShowPlaceholder设为false。