im new to godot and ive figured out how to transfer my other coding experience over but one thing is racking my brain and i dont know if its because it can not be done or because im using the wrong nomenclature.
i have a dictionary that contains the names of buttons in the tree and an 1 or a 0 for if they should be toggled visible or not. the reason for this is that i would like to make a for loop that will show or ignore buttons on first load under _ready depending on they are set to 1 in the dictionary.
so basically all i want to do is a variant of this
but i want the button node name "Button2" to come from the dictionary so something like
for item_name in dict_toggles:
temp = item_name
... #other code
in this case temp = "Button2" but as much as i have searched i can not find an answer or a "no you cant do this"
if anyone can help or point me to an example or just give me a no it cant be done that would be great thank you.
Amazing. That is where I was getting confused since when I looked up $ everything said it was get_node. The only thing I had to change from what you posted was remove the $/root/ then put the grid container name in and it worked perfect.
for item_name in dict_toggle:
var toggleArray = dict_toggle[item_name]
var toggle = toggleArray
if toggle == 1:
get_node("GridContainer1/" + item_name).show()