extends StaticBody2D


export(String, MULTILINE) var text = "Sample Text"

var textbox = preload("res://objects/ui/Textbox.tscn")

var used = false


func use(user):
	#Spawn a text box when used, and start timer to prevent being used immediately after the text is closed
	if !used:
		var newtext = textbox.instance()
		newtext.set_text(text)
		add_child(newtext)
		used = true
		$Timer.start(0.5)


func _on_Timer_timeout():
	used = false
