how to store nodes in an array and edit them?[SOLVED]

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Hade_dev

like edit them with out mentioning the path of it just the array

var buttons = [$play,$settings,$quit]
func _ready():
 buttons.remove[0]
 buttons.modulate = Color(1,1,1,1)

it will color all the buttons white except the play button
this is just an example i know i can use the focus thingy
how to properly code this?(making a list of nodes, removing a certain node,then editing the entire list with one line)

:bust_in_silhouette: Reply From: jgodfrey

Assuming your original array contains valid node references (all of which have a common set of properties), your code isn’t far off. Really, you just need to iterate through the array to access each node. So, something like:

func _ready():
    buttons.remove(0) 
    for button in buttons:
        button.modulate = Color(1,1,1,1)