Scroll container does not appear to register container larger than it's own size when reloaded from save game.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By stubbsy345
:warning: Old Version Published before Godot 3 was released.

I have a container within a scroll container which contains speech boxes, much like a messaging app. I use this for a bit of in game dialogue. Whenever the player saves the game I save the contents of the container, as well as the size of the container (as this grows while the scroll container remains fixed). This works great normally. But when I reload the contents and the container size from the save file, the scroll container does not seem to register that the VBox is greater in size and will not scroll, there is also no scroll bar appearing at the side. Does anybody know why this is happening?

:bust_in_silhouette: Reply From: Aaron

When you say “VBox” you mean a VBoxContainer right?

How are you saving the speech dialog? If you’re saving the dialog as strings then you shouldn’t have to save the size of the box container. You could load the strings, construct the labels for them, and insert them into the box container, which should resize itself automatically. This should be reflected by the scroll container assuming the scroll container is of a fixed size.

That said, there are a few bugs with scroll containers not detecting changes in their children correctly (this seems to be an issue with containers in general). You may need to call the scroll container’s queue_sort method when its child box container is updated, like in response to the box container’s sort_children or resized signals.