I am working on a 2D card game, which requires creating a series of card-related movement animations.
Describe the problem or limitation you are having in your project
I am using HBoxContainer to control the resort of cards. When adding or removing cards in the HBoxContainer, I would like to have smooth movement animations, so that the cards move to their corresponding positions in the resort with animation, rather than just directly changing their position using setPosition as HBoxContainer currently does.
However, after checking HBoxContainer, I couldn't find any method to directly modify the resort behavior to include animations.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Is it possible add a parameter bool manual_sort to BoxContainer, and provide an overridable function void on_manual_sort(Vector2<Vector2> new_pos_arr)?
The new_pos_arr would be the new position data for the nodes. When manual_sort is set to true, on_manual_sort would be called whenever a resort is needed, and the container itself would not perform the sorting behavior, leaving it to the user to handle the sorting.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
none.
If this enhancement will not be used often, can it be worked around with a few lines of script?
Write a own BoxContainer node and specific resort algorithm would work.
Is there a reason why this should be core and not an add-on in the asset library?
I think custom animation for BoxContainer is a common scene.
Describe the project you are working on
I am working on a 2D card game, which requires creating a series of card-related movement animations.
Describe the problem or limitation you are having in your project
I am using HBoxContainer to control the resort of cards. When adding or removing cards in the HBoxContainer, I would like to have smooth movement animations, so that the cards move to their corresponding positions in the resort with animation, rather than just directly changing their position using setPosition as HBoxContainer currently does.
However, after checking HBoxContainer, I couldn't find any method to directly modify the resort behavior to include animations.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Is it possible add a parameter
bool manual_sort
to BoxContainer, and provide an overridable functionvoid on_manual_sort(Vector2<Vector2> new_pos_arr)
?The
new_pos_arr
would be the new position data for the nodes. Whenmanual_sort
is set totrue
,on_manual_sort
would be called whenever a resort is needed, and the container itself would not perform the sorting behavior, leaving it to the user to handle the sorting.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
none.
If this enhancement will not be used often, can it be worked around with a few lines of script?
Write a own
BoxContainer
node and specific resort algorithm would work.Is there a reason why this should be core and not an add-on in the asset library?
I think custom animation for
BoxContainer
is a common scene.