in-world ui textboxes

This commit is contained in:
2026-06-12 09:08:13 -05:00
parent a4d47d7f00
commit b364fae1c7
16 changed files with 265 additions and 27 deletions
+20
View File
@@ -0,0 +1,20 @@
class_name EntityProximityArea extends Area3D
@export var entity:Entity
var _triggered:bool = false
func _ready() -> void:
body_entered.connect(_onBodyEntered)
func _onBodyEntered(body:Node3D) -> void:
if _triggered:
return
if !(body is Entity):
return
if (body as Entity).entityId != "player":
return
_triggered = true
assert(entity != null && entity.chatboxMessage != "")
var chatbox:WorldChatBox = UI.spawnWorldChatBox(entity)
chatbox.showTimed(entity.chatboxMessage, entity.chatboxDuration)