Godot Version
4.2
Question
i am making a list of cards in my game.
theyre just made up of buttons and a label. what i wanted to do was when i press one button it plays a function. all the buttons would do is this
so i would have to make 24 buttons each one just saying card_stats_display(0) then (1) and (2) and so on until 23. i dont want to do this 24 times so i was wondering if there was a way i could make it so that all the buttons lead to one function that called the function but it would give their corresponding number when i pressed the button. im not sure if this sounds confusing. i can give extra context if needed.
for example something like
func _on_button_pressed(number):
card_stats_display(number)
just not sure how i would make the buttons give different numbers?