Files
Ecosystem-Project/scenes/HUD/information_panel.gd
2025-08-26 18:21:20 +02:00

29 lines
635 B
GDScript

extends MarginContainer
@onready var NameLabel: Label = $VBoxContainer/NameLabel
func _ready() -> void:
defaultInfoPanel()
ShowInfoPanel()
func BuildInfoPanel(source: Node2D) -> void:
NameLabel.text = source.name
func defaultInfoPanel() -> void:
NameLabel.text = "Nothing to show..."
func worldInfoPanel() -> void:
NameLabel.text = "World"
var sizeLabel: Label = Label.new()
sizeLabel.text = "Viewportsize: {size}".format({"size": get_viewport_rect().size})
$VBoxContainer/HBoxContainer/EntityInformationContainer.add_child(sizeLabel)
func ShowInfoPanel() -> void:
show()
func HideInfoPanel() -> void:
hide()