Adding method add_child_at_index(node: Node, index: int) to Node class. It would be useful for Nodes with children that generate procedurally.
You can do
add_child(child)
move_child(child, i)
@KoBeWi Yes, I know about this method, and it works well. I meant that method add_child_at_index reduce a little boilerplate code.
Also, it can be used inside add_child_below_node method. Right now add_child_below_node firstly uses the push_back method of Vector, and then use move_child to reorder children. Omitting of the first step will increase performance for a bit
Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine.
The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker.
If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance!
Most helpful comment
@KoBeWi Yes, I know about this method, and it works well. I meant that method add_child_at_index reduce a little boilerplate code.