Skip to content

SusInteractPrompt

SusInteractPrompt

Single interact hint — key badge + text; click / keyboard fires OnInteract.

Package

SusGame · HUD (commercial)

Open in Playground

SusGame · HUD

Props

NameTypeDefault
KeyProp<string>"E"
TextProp<string>"Interact"
VisibleProp<bool>true
BindActionProp<string>(string)null

Slots

No slots.

Events

NameFieldPayload
InteractOnInteract

Style hooks

USS class contract — override appearance without touching C#. States toggle via these classes:

  • sus-interact-prompt
  • sus-interact-prompt__key
  • sus-interact-prompt__text
  • sus-interact-prompt--hidden

Usage

csharp
var prompt = new SusInteractPrompt();
prompt.Key.Value = "E";
prompt.Text.Value = "Open door";
prompt.Visible.Value = true;
prompt.OnInteract += () => { /* use / open */ };
xml
<template>
  <sus:SusInteractPrompt :Key="Key.Value"
                         :Text="Label.Value"
                         :Visible="Show.Value"
                         @interact="OnInteract" />
</template>

<script>
public Prop<string> Key = new("E");
public Prop<string> Label = new("Open door");
public Prop<bool> Show = new(true);
void OnInteract() { /* … */ }
</script>
Prop / APIRole
KeyBadge text (default E)
TextAction label (rendered as — {Text})
VisibleToggles --hidden (display: none)
OnInteractClick or keyboard activate

Notes

  • Keyboard handler accepts E / Space / Enter when visible (badge Key is display; activation keys are fixed in component).
  • Host several prompts in SusPromptBar via SetPrompts / AddPrompt.