How to make a scroll container appear above other canvas items (such as buttons) when another button is pressed?

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

I am currently creating an inventory with 3 columns. In the middle one I have a button which shall make a scroll container appear above the other stuff in the inventory. I am not entirely sure how to go about this, so I first tried to create a new scene with the scroll container and make it appear on button pressed. Well this works, BUT the rest of the inventory disappears as I change the scene… This does not look quiet all right. Is there another way to do this?

This is how I change scenes:

func goto_scene(path):
call_deferred("_deferred_goto_scene", path)

func _deferred_goto_scene(path):
current_scene.free()
var s = ResourceLoader.load(path)
current_scene = s.instance()
get_tree().get_root().add_child(current_scene)
get_tree().set_current_scene(current_scene)

Maybe I should not use the current_scene.free(), but in general I am not sure if changing scenes is a good way to tackle this.

Apparently, ommitting the current_scene.free() makes everything look alright, but I am still not sure if changing the scene is really neccessary and a good solution.

Ciavarie | 2020-08-30 21:52