get_node and $ paths - how to deal with changing paths?

monk-e-boymonk-e-boy Posts: 5Member

So I hooked up some GUI controls to other parts of my code. Also, my code will update the GUI controls.
How do I deal with playing around with how the GUI looks? I'll move some of the controls into a grid, then maybe put a panel inside to see if it looks ok. Or maybe move some of the controls into a horizontal list...

The paths keep changing. And my code breaks. Is there a way to "find in tree" an item? My GUI controls all have unique names, so maybe something like $GUI/*/uniqueName

Comments

  • TwistedTwiglegTwistedTwigleg Posts: 3,330Admin

    You could try using the find_node function on the parent node. It should work, if all of the nodes have unique names.

  • monk-e-boymonk-e-boy Posts: 5Member

    I ended up just using signals, Godot has made them really nice to use. I was worried about re-naming GUI objects and the signal events changing names, it is an issue, but it's not as bad as I was worrying about :)

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file