HUD Rework and integration
This commit is contained in:
29
scenes/HUD/information_panel.gd
Normal file
29
scenes/HUD/information_panel.gd
Normal file
@@ -0,0 +1,29 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user