Team Screen propagates images

This commit is contained in:
2024-05-31 20:43:30 -04:00
parent 480ac45218
commit 394beabb7c
21 changed files with 440 additions and 295 deletions

25
TeamSelection.gd Normal file
View File

@@ -0,0 +1,25 @@
extends GridContainer
# Signal to send texture data back to the main scene
signal texture_selected(texture : AtlasTexture)
# Called when the node enters the scene tree for the first time.
func _ready():
# Iterate over all children of the GridContainer
for button in get_children():
# Check if the child is a TextureButton
if button is TextureButton:
# Connect the pressed signal of the TextureButton to the handler function
button.connect("pressed", Callable(self, "_on_TextureButton_pressed").bind(button))
# Handler function for the pressed signal
func _on_TextureButton_pressed(button):
# Print the name of the button
print("Button pressed: ", button.name)
#Texture Variable
var texture : AtlasTexture = button.texture_normal
Global.selected_texture = texture
get_tree().change_scene_to_file("res://User Interface/UserInterface.tscn")