![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | DomtronVox |
I have created a custom UI Container that implements a radial menu. Currently I am using a custom function ( add_button(node) ) to add_child then recalculate each child’s position. However, I should just run the reposition function whenever a change to the container’s immediate children happens.
I found this question and answer which half works for me. Half because I am able to override the remove_child function. Not the other half because add_child gives me an error
My code:
#update positioning whenever a child node changes
func add_child(node):
.add_child(node)
position_buttons()
func remove_child(node):
.remove_child(node)
position_buttons()
The error it gives:
Function signature doesn’t match the Parent. Parent signature is ‘void add_child(Node node, bool=default)’.
in response I tried the following change:
func add_child(node, bool=default):
.add_child(node)
position_buttons()
func remove_child(node):
.remove_child(node)
position_buttons()
However this obviously gives an error since the argument’s name is a reserved keyword type. At least that is how I’m interpreting the error message:
Expected identifier for argument
I’m wondering if this is either a bug in godot or I’m just an idiot.
Any help would be much appreciated. Thanks ahead of time.